/* ==============================================================================
   UGCMS - Authentication Pages (Login + Register)
   ============================================================================== */

.auth-page {
    position: relative;
    min-height: calc(100vh - 200px);
    padding: 60px 0;
    background: linear-gradient(135deg, var(--gray-50), #fff);
    display: flex;
    align-items: center;
}

.auth-bg-decoration {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(15,68,34,0.05), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(212,160,23,0.06), transparent 40%);
    pointer-events: none;
}

.auth-container {
    position: relative;
    z-index: 1;
    max-width: 1100px !important;
    width: 100%;
}

.auth-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 600px;
    border: 1px solid var(--gray-200);
}

.auth-card-register {
    grid-template-columns: 0.8fr 1.2fr;
    min-height: 700px;
}

/* ============ العمود الجانبي ============ */
.auth-side {
    position: relative;
    padding: 50px 40px;
    color: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.auth-side-login {
    background: linear-gradient(155deg, var(--uofg-green-900) 0%, var(--uofg-green-800) 60%, var(--uofg-gold-700) 140%);
}

.auth-side-register {
    background: linear-gradient(155deg, var(--uofg-gold-700) 0%, var(--uofg-green-800) 60%, var(--uofg-green-900) 100%);
}

.auth-side::before {
    content: '';
    position: absolute;
    top: -30%;
    inset-inline-end: -25%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(212,160,23,0.25), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-side::after {
    content: '';
    position: absolute;
    bottom: -20%;
    inset-inline-start: -15%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-side-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.auth-logo {
    height: 70px;
    width: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.3));
}

.auth-side-title {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 14px;
}

.auth-side-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.85);
    line-height: 1.75;
    margin-bottom: 32px;
}

.auth-side-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    backdrop-filter: blur(6px);
}

.auth-feature .feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.auth-feature strong {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 3px;
}

.auth-feature p {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    margin: 0;
    line-height: 1.5;
}

/* مزايا التسجيل */
.register-benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.register-benefits li {
    font-size: 13.5px;
    color: rgba(255,255,255,0.92);
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    border-inline-start: 3px solid var(--uofg-gold-500);
    font-weight: 600;
}

/* ============ العمود الأيمن (النموذج) ============ */
.auth-form-side {
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 30px;
}

.auth-title {
    font-size: 26px;
    font-weight: 900;
    color: var(--uofg-green-900);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ============ Role Selector ============ */
.role-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 6px;
}

.role-selector-3 {
    grid-template-columns: repeat(3, 1fr);
}

.role-option {
    cursor: pointer;
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px;
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--t-fast);
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.role-option:hover .role-option-content {
    border-color: var(--uofg-green-600);
    background: var(--uofg-green-50);
}

.role-option input:checked + .role-option-content {
    border-color: var(--uofg-green-800);
    background: var(--uofg-green-50);
    box-shadow: 0 0 0 3px rgba(15,68,34,0.1);
}

.role-option-icon {
    font-size: 22px;
    line-height: 1;
}

.role-option-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-700);
    line-height: 1.3;
}

.role-option input:checked + .role-option-content .role-option-label {
    color: var(--uofg-green-800);
}

/* ============ Form Rows ============ */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
    accent-color: var(--uofg-green-700);
    width: 16px;
    height: 16px;
}

.link-forgot {
    font-size: 13px;
    color: var(--uofg-green-700);
    font-weight: 700;
}
.link-forgot:hover { color: var(--uofg-green-900); text-decoration: underline; }

/* ============ Password Field ============ */
.password-field {
    position: relative;
}

.password-field .form-control {
    padding-inline-end: 44px;
}

.password-toggle {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--gray-500);
    transition: all var(--t-fast);
}

.password-toggle:hover {
    background: var(--gray-100);
    color: var(--uofg-green-800);
}

/* ============ Hints & Alerts ============ */
.form-hint {
    display: block;
    font-size: 11.5px;
    color: var(--gray-500);
    margin-top: 4px;
    line-height: 1.5;
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.6;
}

.alert-error {
    background: #fee2e2;
    color: var(--sd-red-dark);
    border: 1px solid #fca5a5;
    border-inline-start: 4px solid var(--sd-red);
}

.alert-error ul {
    margin: 8px 0 0;
    padding-inline-start: 20px;
    font-weight: 500;
}

.alert-error li { margin-bottom: 4px; }

.alert-success {
    background: var(--uofg-green-100);
    color: var(--uofg-green-900);
    border: 1px solid var(--uofg-green-500);
    border-inline-start: 4px solid var(--uofg-green-700);
}

/* ============ Divider + Switch ============ */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 22px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 1px;
    background: var(--gray-200);
}

.auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 14px;
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 600;
}

.auth-switch {
    text-align: center;
    font-size: 13.5px;
    color: var(--gray-500);
    margin-top: 6px;
}

.link-primary {
    color: var(--uofg-green-700);
    font-weight: 800;
    margin-inline-start: 4px;
}

.link-primary:hover {
    color: var(--uofg-green-900);
    text-decoration: underline;
}

/* ============ Wide Variant ============ */
.auth-page-wide .auth-container {
    max-width: 1200px !important;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
    .auth-card,
    .auth-card-register {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .auth-side {
        padding: 40px 30px;
        text-align: center;
    }
    .auth-side-features,
    .register-benefits { text-align: start; }
    .auth-form-side { padding: 40px 26px; }
    .role-selector,
    .role-selector-3 { grid-template-columns: repeat(2, 1fr); }
    .form-row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-page { padding: 30px 0; }
    .auth-form-side { padding: 30px 20px; }
    .auth-side { padding: 30px 20px; }
    .auth-title { font-size: 22px; }
    .auth-side-title { font-size: 20px; }
}