/* Student login — UbiqCure eHRC */

:root {
    --sl-page-pad-x: clamp(20px, 3vw, 48px);
    --sl-brand-max: 38rem;
    --sl-form-max: 400px;
    --sl-indigo: #4f46e5;
    --sl-violet: #6d28d9;
    --sl-line: #e2e8f0;
    --sl-text-muted: #64748b;
    --sl-text-body: #475569;
    --sl-input-h: 44px;
    --sl-focus-ring: 0 0 0 3px rgba(124, 58, 237, 0.18);
    --sl-topbar-h: 56px;
    /* Type scale — brand panel */
    --sl-type-kicker: clamp(0.8125rem, 0.9vw, 0.875rem);
    --sl-type-h1: clamp(1.75rem, 3.8vw, 2.875rem);
    --sl-type-lead: clamp(1rem, 1.15vw, 1.1875rem);
    --sl-type-feature: clamp(0.875rem, 0.95vw, 1rem);
}

.student-login-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(160deg, #eef4ff 0%, #f8fafc 42%, #ede9fe 100%);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: #0f172a;
    overflow-x: hidden;
}

/* ── Top bar ── */
.student-login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--sl-topbar-h);
    padding: 0 var(--sl-page-pad-x);
    width: 100%;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.student-login-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sl-indigo);
    text-decoration: none;
    padding: 6px 0;
    border-radius: 6px;
}

.student-login-back:hover {
    color: #4338ca;
}

.student-login-back:focus-visible,
.student-login-help-btn:focus-visible,
.student-login-password-toggle:focus-visible,
.student-login-btn-main:focus-visible,
.student-login-form-help-link:focus-visible {
    outline: 2px solid var(--sl-indigo);
    outline-offset: 2px;
}

.student-login-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c7d2fe;
    background: #fff;
    color: var(--sl-indigo);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
}

.student-login-help-btn:hover {
    background: #eef2ff;
    border-color: #a5b4fc;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.1);
}

/* ── Main layout ── */
.student-login-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px var(--sl-page-pad-x) 28px;
    min-height: 0;
}

.student-login-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
}

/* ── Brand / info panel ── */
.student-login-brand {
    padding: 4px 0;
}

.student-login-brand-inner {
    max-width: var(--sl-brand-max);
}

.student-login-brand-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: var(--sl-type-kicker);
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--sl-violet);
    margin-bottom: clamp(16px, 2.5vh, 22px);
}

.student-login-brand-kicker i {
    font-size: 1.05em;
}

.student-login-brand h1 {
    font-size: var(--sl-type-h1);
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: clamp(12px, 2vh, 18px);
    letter-spacing: -0.03em;
    color: #0f172a;
    max-width: 16ch;
    text-wrap: balance;
}

.student-login-brand-lead {
    font-size: var(--sl-type-lead);
    font-weight: 500;
    line-height: 1.65;
    color: var(--sl-text-body);
    margin-bottom: clamp(22px, 3vh, 32px);
    max-width: 38ch;
}

.student-login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: clamp(10px, 1.5vh, 14px);
}

.student-login-features li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--sl-line);
    border-radius: 14px;
    padding: clamp(12px, 1.8vh, 16px) clamp(14px, 2vw, 18px);
    font-size: var(--sl-type-feature);
    font-weight: 500;
    line-height: 1.55;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.student-login-features i {
    color: var(--sl-violet);
    font-size: 1.125rem;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Login card ── */
.student-login-form-wrap {
    width: 100%;
}

.student-login-card {
    background: #fff;
    border-radius: 18px;
    padding: 28px 24px 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(226, 232, 240, 0.9);
    width: 100%;
    max-width: var(--sl-form-max);
    margin: 0 auto;
}

.student-login-card-header {
    margin-bottom: 20px;
}

.student-login-portal-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: var(--sl-violet);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.student-login-card-header h2 {
    font-size: 1.375rem;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
}

.student-login-card-header p {
    font-size: 0.8125rem;
    color: var(--sl-text-muted);
    margin: 0;
    line-height: 1.45;
}

/* ── Form fields ── */
.student-login-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.student-login-field .form-control {
    border-radius: 10px;
    min-height: var(--sl-input-h);
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    font-size: 0.9375rem;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.student-login-field .form-control:hover:not(:disabled):not(:focus) {
    border-color: #94a3b8;
}

.student-login-field .form-control:focus {
    border-color: #7c3aed;
    box-shadow: var(--sl-focus-ring);
    outline: none;
}

.student-login-field .form-control.is-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.student-login-field .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.student-login-field .invalid-feedback {
    display: none;
    font-size: 0.75rem;
    color: #b91c1c;
    margin-top: 5px;
    line-height: 1.4;
}

.student-login-field:has(.form-control.is-invalid) > .invalid-feedback {
    display: block;
}

.student-login-input-icon-wrap {
    position: relative;
}

.student-login-input-icon-wrap .form-control {
    padding-left: 40px;
    width: 100%;
}

.student-login-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.95rem;
}

/* Password row */
.student-login-password-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.student-login-password-wrap {
    flex: 1;
    min-width: 0;
}

.student-login-password-wrap .form-control {
    border-radius: 10px 0 0 10px;
    border-right: none;
    padding-right: 10px;
}

.student-login-password-toggle {
    flex-shrink: 0;
    width: 44px;
    min-height: var(--sl-input-h);
    border: 1px solid #cbd5e1;
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: #f8fafc;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.student-login-password-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

.student-login-field:has(.form-control.is-invalid) .student-login-password-toggle {
    border-color: #dc2626;
}

.student-login-field:has(.form-control.is-invalid) .student-login-password-wrap .form-control {
    border-color: #dc2626;
}

.student-login-alt-note {
    font-size: 0.75rem;
    color: var(--sl-text-muted);
    line-height: 1.45;
    margin: 0;
}

.student-login-form-help-link {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 6px 0;
    border: none;
    background: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sl-indigo);
    text-align: center;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    border-radius: 4px;
}

.student-login-form-help-link:hover {
    color: #4338ca;
}

.student-login-btn-main {
    width: 100%;
    min-height: var(--sl-input-h);
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #fff;
    background: linear-gradient(135deg, var(--sl-violet), var(--sl-indigo));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    transition: opacity 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.student-login-btn-main:hover:not(:disabled) {
    opacity: 0.96;
    color: #fff;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.28);
}

.student-login-btn-main:active:not(:disabled) {
    transform: translateY(1px);
}

.student-login-btn-main:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.student-login-btn-main .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

#loginAlert {
    margin-bottom: 16px;
}

/* ── Footer ── */
.student-login-footer {
    padding: 16px var(--sl-page-pad-x) 22px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--sl-text-muted);
    width: 100%;
    margin: 0 auto;
    flex-shrink: 0;
}

.student-login-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-bottom: 8px;
}

.student-login-footer-links a {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
}

.student-login-footer-links a:hover {
    color: var(--sl-indigo);
}

.student-login-footer-links a:focus-visible {
    outline: 2px solid var(--sl-indigo);
    outline-offset: 2px;
    border-radius: 4px;
}

.student-login-footer-disclaimer {
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Tablet (768–1023) ── */
@media (min-width: 768px) and (max-width: 1023px) {
    .student-login-main {
        padding: 24px var(--sl-page-pad-x) 32px;
    }

    .student-login-grid {
        max-width: 100%;
        grid-template-columns: minmax(0, 1.05fr) minmax(300px, 42%);
        gap: 28px;
        align-items: center;
    }

    .student-login-brand-inner {
        max-width: 26rem;
    }

    .student-login-brand h1 {
        font-size: clamp(1.65rem, 2.8vw, 2rem);
        max-width: 18ch;
    }

    .student-login-brand-lead {
        font-size: 1rem;
        max-width: 34ch;
    }

    .student-login-features li {
        font-size: 0.875rem;
        padding: 12px 14px;
    }

    .student-login-features i {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    .student-login-card {
        max-width: 380px;
        padding: 26px 22px 22px;
    }

    .student-login-card-header {
        text-align: left;
    }

    .student-login-form-help-link {
        text-align: left;
    }
}

/* ── Desktop (≥1024) ── */
@media (min-width: 1024px) {
    .student-login-page {
        background: #f8fafc;
    }

    .student-login-topbar {
        background: #fff;
        backdrop-filter: none;
    }

    .student-login-main {
        align-items: stretch;
        padding: 0;
        flex: 1;
    }

    .student-login-grid {
        max-width: none;
        width: 100%;
        margin: 0;
        grid-template-columns: minmax(0, 68%) minmax(360px, 32%);
        gap: 0;
        min-height: calc(100dvh - var(--sl-topbar-h) - 72px);
        align-items: stretch;
    }

    .student-login-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: clamp(40px, 6vh, 64px) clamp(40px, 5vw, 72px);
        background:
            radial-gradient(ellipse 70% 55% at 12% 18%, rgba(109, 40, 217, 0.07), transparent 55%),
            radial-gradient(ellipse 60% 45% at 88% 82%, rgba(79, 70, 229, 0.06), transparent 50%),
            linear-gradient(155deg, #eef4ff 0%, #f8fafc 50%, #ede9fe 100%);
        border-right: 1px solid rgba(226, 232, 240, 0.9);
        overflow: hidden;
    }

    .student-login-brand::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: radial-gradient(rgba(79, 70, 229, 0.06) 1px, transparent 1px);
        background-size: 20px 20px;
        opacity: 0.4;
        pointer-events: none;
    }

    .student-login-brand {
        position: relative;
    }

    .student-login-brand-inner {
        position: relative;
        z-index: 1;
        max-width: var(--sl-brand-max);
        width: 100%;
    }

    .student-login-brand h1 {
        font-size: clamp(2.125rem, 2.9vw, 2.875rem);
        max-width: 15ch;
        line-height: 1.1;
        margin-bottom: 20px;
    }

    .student-login-brand-lead {
        font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
        line-height: 1.7;
        max-width: 40ch;
        margin-bottom: 32px;
    }

    .student-login-features {
        gap: 12px;
    }

    .student-login-features li {
        font-size: 1rem;
        padding: 16px 18px;
        gap: 16px;
    }

    .student-login-features i {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
        border-radius: 12px;
    }

    .student-login-form-wrap {
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: clamp(32px, 5vh, 56px) clamp(24px, 3vw, 48px);
    }

    .student-login-card {
        max-width: var(--sl-form-max);
        width: 100%;
        margin: 0;
        padding: 32px 28px 28px;
        box-shadow: none;
        border: 1px solid var(--sl-line);
        border-radius: 16px;
    }

    .student-login-card-header {
        text-align: left;
    }

    .student-login-form-help-link {
        text-align: left;
    }

    .student-login-footer {
        max-width: none;
        border-top: 1px solid var(--sl-line);
        background: #fff;
        padding: 14px var(--sl-page-pad-x) 20px;
    }

    .student-login-footer-disclaimer {
        max-width: 52rem;
    }
}

/* ── Mobile (<768) ── */
@media (max-width: 767.98px) {
    .student-login-main {
        padding: 16px 22px 24px;
        align-items: flex-start;
    }

    .student-login-grid {
        gap: 20px;
        max-width: 100%;
    }

    .student-login-brand {
        text-align: center;
        padding: 0;
    }

    .student-login-brand-inner {
        max-width: 100%;
        margin: 0 auto;
    }

    .student-login-brand h1 {
        font-size: 1.35rem;
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .student-login-brand-lead {
        font-size: 0.875rem;
        max-width: 28rem;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0;
    }

    .student-login-features {
        display: none;
    }

    .student-login-card {
        padding: 24px 20px 20px;
        border-radius: 16px;
        box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    }

    .student-login-card-header {
        text-align: center;
    }

    .student-login-portal-icon {
        margin-left: auto;
        margin-right: auto;
        display: flex;
    }

    .student-login-help-btn .help-label {
        display: none;
    }
}

@media (min-width: 480px) and (max-width: 767.98px) {
    .student-login-brand-lead {
        max-width: 24rem;
    }
}

/* ── Help dialog (unchanged structure) ── */
.student-login-help-dialog {
    border: none;
    border-radius: 18px;
    padding: 0;
    width: min(92vw, 720px);
    max-height: 88vh;
    background: transparent;
    overflow: visible;
}

.student-login-help-dialog::backdrop {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.student-login-help-dialog-inner {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 88vh;
}

.student-login-help-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #f5f3ff, #eef2ff);
    border-bottom: 1px solid var(--sl-line);
    padding: 16px 18px;
}

.student-login-help-dialog-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.student-login-help-close {
    border: none;
    background: #fff;
    color: var(--sl-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.student-login-help-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.student-login-help-close:focus-visible {
    outline: 2px solid var(--sl-indigo);
    outline-offset: 2px;
}

.student-login-help-dialog-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.student-login-help-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--sl-line);
    padding: 0 12px;
    background: #f8fafc;
    overflow-x: auto;
}

.student-login-help-tab {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sl-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 12px 14px;
    white-space: nowrap;
    cursor: pointer;
}

.student-login-help-tab.is-active {
    color: var(--sl-violet);
    border-bottom-color: var(--sl-violet);
}

.student-login-help-tab:focus-visible {
    outline: 2px solid var(--sl-indigo);
    outline-offset: -2px;
}

.student-login-help-panels {
    overflow-y: auto;
    max-height: min(58vh, 480px);
}

.student-login-help-panel {
    display: none;
    padding: 20px 22px 24px;
}

.student-login-help-panel.is-active {
    display: block;
}

.student-login-help-panel[hidden] {
    display: none !important;
}

.student-login-help-panel h6 {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 10px;
    color: #0f172a;
}

.student-login-help-panel p,
.student-login-help-panel li {
    font-size: 0.84rem;
    line-height: 1.55;
    color: #475569;
}

.student-login-help-steps {
    margin: 0 0 16px;
    padding-left: 1.2rem;
}

.student-login-help-steps li {
    margin-bottom: 8px;
}

.student-login-help-callout {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: #5b21b6;
}

.student-login-help-callout.is-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.student-login-help-links {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.student-login-help-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sl-indigo);
    text-decoration: none;
}

.student-login-help-links a:hover {
    text-decoration: underline;
}

.student-login-help-checklist {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.student-login-help-checklist li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 8px;
}

.student-login-help-checklist li::before {
    content: "\F26A";
    font-family: bootstrap-icons;
    position: absolute;
    left: 0;
    color: var(--sl-violet);
    font-size: 0.85rem;
}
