/* ==========================================================================
   SIKKHALAY STUDENT PORTAL — ADVANCED RESPONSIVE AUTHENTICATION (CSS)
   Design: Corporate, High-Performance, Mobile-First (320px - 4K Displays)
   Theme: Emerald Green (#059669, #047857), Slate Navy (#0F172A), Soft Surfaces
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Emerald Brand Theme for Student Portal */
    --student-primary: #059669;
    --student-primary-hover: #047857;
    --student-primary-dark: #064E3B;
    --student-primary-light: #ECFDF5;
    --student-primary-soft: #F0FDF4;
    --student-primary-glow: rgba(5, 150, 105, 0.22);

    --student-navy: #0F172A;
    --student-navy-light: #1E293B;
    --student-sky: #0284C7;
    --student-indigo: #4F46E5;

    /* Surfaces & Backgrounds */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    --border-card: #E2E8F0;
    --border-input: #CBD5E1;

    --text-dark: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --text-subtle: #94A3B8;

    --status-danger: #EF4444;
    --status-success: #10B981;
    --status-warning: #F59E0B;

    --font-family: 'Hind Siliguri', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-pill: 9999px;

    --shadow-card: 0 16px 40px -12px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(226, 232, 240, 0.85);
    --shadow-btn: 0 4px 14px rgba(5, 150, 105, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-page);
    background-image: 
        radial-gradient(at 15% 15%, rgba(16, 185, 129, 0.10) 0px, transparent 40%),
        radial-gradient(at 85% 85%, rgba(2, 132, 199, 0.06) 0px, transparent 45%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.03) 0px, transparent 50%),
        var(--bg-page);
    background-attachment: fixed;
    font-family: var(--font-family);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   AUTHENTICATION CARD CONTAINER
   ========================================================================== */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
    overflow: hidden;
    margin: auto;
    animation: cardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-card.register-card {
    max-width: 580px;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top Banner Container — Natural Aspect Ratio (1448 x 925) */
.auth-banner-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    line-height: 0;
    background: #F1F5F9;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.auth-banner-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1448 / 925;
    object-fit: cover;
    object-position: center top;
}

/* Card Body Content */
.auth-card-body {
    padding: 24px 26px;
}

/* Header Area */
.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 13px;
    border-radius: var(--radius-pill);
    background: var(--student-primary-light);
    color: var(--student-primary);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid #A7F3D0;
}

.auth-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-dark);
    margin: 8px 0 4px 0;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
    position: relative;
}

.form-grid .form-group {
    margin-bottom: 0;
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-body);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-label span.req {
    color: var(--status-danger);
    font-weight: 800;
}

.interactive-detect-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--student-primary-light);
    color: var(--student-primary);
    border: 1px solid #A7F3D0;
    animation: fadeIn 0.2s ease-out;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-subtle);
    font-size: 15px;
    pointer-events: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.form-control {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-dark);
    transition: all 0.2s ease;
    outline: none;
}

.form-control:focus {
    background: #FFFFFF;
    border-color: var(--student-primary);
    box-shadow: 0 0 0 3.5px var(--student-primary-glow);
}

.input-wrapper:focus-within .input-icon {
    color: var(--student-primary);
    transform: scale(1.1);
}

.form-control.is-invalid {
    border-color: var(--status-danger);
    background: #FEF2F2;
}

.form-control.is-valid {
    border-color: var(--status-success);
}

.field-error-hint {
    display: none;
    font-size: 11.5px;
    color: var(--status-danger);
    font-weight: 600;
    margin-top: 2px;
}

.field-error-hint.visible,
.field-error-hint.active {
    display: block;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
}

/* Password Toggle Icon */
.toggle-password-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--student-primary);
    transform: scale(1.1);
}

/* Utility Row */
.auth-utility-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2px 0 16px 0;
    font-size: 13px;
    gap: 8px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-body);
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    accent-color: var(--student-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    border-radius: 4px;
}

.auth-forgot-link {
    color: var(--student-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: var(--student-primary-hover);
    text-decoration: underline;
}

/* Primary CTA Button */
.btn-auth-primary {
    width: 100%;
    height: 46px;
    padding: 0 20px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-btn);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-auth-primary:hover {
    background: linear-gradient(135deg, #047857 0%, #064E3B 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.35);
}

.btn-auth-primary:active {
    transform: translateY(0);
}

.btn-auth-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Secondary Navigation Buttons in Wizard */
.btn-auth-secondary {
    padding: 0 18px;
    height: 46px;
    background: #F1F5F9;
    color: var(--text-dark);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-auth-secondary:hover {
    background: #E2E8F0;
    color: #0F172A;
}

.wizard-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

/* Demo Fast Login Button */
.btn-auth-demo {
    width: 100%;
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--student-primary-soft);
    border: 1.5px dashed var(--student-primary);
    border-radius: var(--radius-md);
    color: var(--student-primary-dark);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-auth-demo:hover {
    background: var(--student-primary-light);
    border-color: var(--student-primary-hover);
    color: #064E3B;
    transform: translateY(-1px);
}

/* Trust Note */
.auth-trust-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-subtle);
    font-weight: 500;
}

.auth-trust-note svg {
    color: var(--student-primary);
}

/* Footer Switch Links */
.auth-footer-text {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
}

.auth-footer-text a {
    color: var(--student-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-footer-text a:hover {
    color: var(--student-primary-hover);
    text-decoration: underline;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-subtle);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-back-link:hover {
    color: var(--text-body);
}

/* Alert Toast Box */
.auth-alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    animation: alertSlide 0.25s ease-out;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert.danger,
.auth-alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--status-danger);
    display: flex;
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--status-success);
    display: flex;
}

.auth-alert.warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #92400E;
    display: flex;
}

/* ==========================================================================
   REGISTRATION 5-STEP WIZARD STYLING
   ========================================================================== */
.wizard-steps-container {
    margin-bottom: 20px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: #E2E8F0;
    border-radius: 9999px;
    z-index: 1;
}

.wizard-progress-bar {
    position: absolute;
    top: 15px;
    left: 10px;
    height: 3px;
    background: linear-gradient(90deg, #059669, #10B981);
    border-radius: 9999px;
    z-index: 2;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
}

.wizard-step-item {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #CBD5E1;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.wizard-step-item.active .step-circle {
    border-color: var(--student-primary);
    background: var(--student-primary);
    color: #FFFFFF;
    box-shadow: var(--shadow-btn);
    transform: scale(1.1);
}

.wizard-step-item.completed .step-circle {
    border-color: var(--student-primary);
    background: var(--student-primary-light);
    color: var(--student-primary);
}

.step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.wizard-step-item.active .step-label {
    color: var(--student-primary);
}

.wizard-step-title-chip {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--student-primary-dark);
    background: var(--student-primary-light);
    border: 1px solid #A7F3D0;
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    margin: 6px auto 0;
    width: fit-content;
}

.wizard-form-step {
    display: none;
}

.wizard-form-step.active {
    display: block;
    animation: stepSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stepSlide {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Autocomplete Suggestion Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1.5px solid var(--border-card);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    padding: 4px 0;
}

.autocomplete-dropdown.active {
    display: block;
}

.autocomplete-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0F172A;
    cursor: pointer;
    border-bottom: 1px solid #F8FAFC;
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--student-primary-light);
    color: var(--student-primary-dark);
}

.autocomplete-item-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: #F1F5F9;
    color: #64748B;
}

/* Password Strength Meter */
.pass-strength-meter {
    height: 4px;
    background: #E2E8F0;
    border-radius: 9999px;
    margin-top: 6px;
    overflow: hidden;
}

.pass-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.pass-strength-bar.weak { width: 33%; background: var(--status-danger); }
.pass-strength-bar.medium { width: 66%; background: var(--status-warning); }
.pass-strength-bar.strong { width: 100%; background: var(--status-success); }

/* Review Summary Card */
.summary-review-card {
    background: #F8FAFC;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.summary-review-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-review-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 13px;
}

.summary-review-row:last-child {
    border-bottom: none;
}

.summary-review-key {
    color: var(--text-muted);
    font-weight: 600;
}

.summary-review-val {
    color: var(--text-dark);
    font-weight: 700;
}

/* ==========================================================================
   FORGOT PASSWORD MODAL
   ========================================================================== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal-card {
    background: #FFFFFF;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 26px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #F1F5F9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748B;
    font-size: 14px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS (MOBILE 320px - 540px)
   ========================================================================== */
@media (max-width: 540px) {
    body.auth-page {
        padding: 14px 10px;
    }

    .auth-card {
        border-radius: var(--radius-lg);
    }

    .auth-card-body {
        padding: 18px 16px;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-subtitle {
        font-size: 12.5px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-control {
        height: 42px;
        font-size: 13.5px;
        padding-left: 38px;
    }

    .input-icon {
        left: 12px;
        font-size: 14px;
    }

    .btn-auth-primary,
    .btn-auth-secondary {
        height: 44px;
        font-size: 14px;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-label {
        font-size: 10px;
    }
}

@media (max-width: 360px) {
    body.auth-page {
        padding: 10px 6px;
    }

    .auth-card-body {
        padding: 16px 12px;
    }

    .auth-title {
        font-size: 18.5px;
    }

    .form-control {
        font-size: 13px;
        padding-left: 34px;
    }

    .input-icon {
        left: 10px;
        font-size: 13px;
    }

    .step-label {
        display: none;
    }
}