/* =========================
   SchoolPixels — Auth pages theme
   Shared by: index.php, parent_login.php, student_login.php,
   student_login.php, forgot_password.php, library/login.php
   Keep one copy so every sign-in screen stays visually identical --
   edit here, not per-page.
   ========================= */
:root {
    --main-bg: linear-gradient(135deg, #2c3e50, #4ca1af);
    --card-bg: rgba(255, 255, 255, 0.22);
    --card-border: rgba(255, 255, 255, 0.18);

    --input-bg: #f5f7fa;
    --input-border: #6a82fb;
    --text: #ffffff;
    --muted: rgba(255,255,255,0.78);

    --radius: 22px;
    --shadow: 0 14px 44px rgba(0,0,0,0.24);
    --nav-h: 56px;
}

* { box-sizing: border-box; }

body.auth-theme-page {
    margin: 0;
    background: var(--main-bg);
    font-family: 'Nunito', Arial, sans-serif;
    min-height: 100vh;
    color: var(--text);
    display: grid;
    place-items: center;
    padding-top: var(--nav-h);
}

body.auth-theme-page main {
    width: 100%;
    padding: 26px 14px;
    display: grid;
    place-items: center;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.2rem 2.5rem 2rem;
    width: 500px;
    max-width: 96vw;
    min-height: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    backdrop-filter: blur(10px);
}

@media (max-width: 520px) {
    .auth-card {
        padding: 1.2rem 0.9rem 1.1rem;
        width: 99vw;
        min-height: unset;
    }
}

/* -- Top navbar -- */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(25, 44, 56, .80);
    backdrop-filter: blur(14px) saturate(1.5);
    border-bottom: 1px solid rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    padding: 0 1.2rem;
    z-index: 200;
    gap: .8rem;
}
.nav-brand {
    font-size: 1.08rem;
    font-weight: 900;
    letter-spacing: -.02em;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    font-family: 'Nunito', Arial, sans-serif;
}
.nav-brand .brand-pixels {
    background: linear-gradient(90deg, #6a82fb, #00c0fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-left: auto;
}
.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .27rem .72rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: background .15s, color .15s;
    border: 1px solid transparent;
}
.nav-links a:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.18);
    color: #fff;
}
.nav-links a i { font-size: .85em; }

/* Header */
.login-header {
    text-align: center;
    margin-top: 5rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.favicon-container {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(44,62,80,0.14);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 14px 34px rgba(0,0,0,0.16);
    margin-bottom: 10px;
    overflow: hidden;
}

.favicon-container img {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: block;
}

.login-header h2 {
    font-size: 2.1em;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.brand-chip {
    font-size: 1.05em;
    margin-top: 0.6rem;
    margin-bottom: 0.2rem;
    background: linear-gradient(45deg, #edc68fff 0%, #8a7958ff 100%);
    color: #202021ff;
    border-radius: 10px;
    padding: 0.55em 1.05em;
    font-weight: 800;
    display: inline-block;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    line-height: 1.2;
}

/* Form */
.auth-theme-page .form-label {
    color: var(--text);
    font-weight: 700;
    margin-bottom: .35em;
}

.auth-theme-page .input-group-text {
    background: #232b3a;
    border: 1px solid var(--input-border);
    color: #6a82fb;
    border-radius: 12px 0 0 12px;
}

.auth-theme-page .form-control,
.auth-theme-page .form-select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: #232b3a;
    border-left: 0;
    border-radius: 0 12px 12px 0;
    font-size: 1.05em;
    font-weight: 700;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
}

.auth-theme-page .form-control:not(.input-group .form-control) {
    border-left: 1px solid var(--input-border);
    border-radius: 12px;
}

/* No visible change on click/focus -- same border, no glow ring */
.auth-theme-page .form-control:focus,
.auth-theme-page .form-select:focus {
    border-color: var(--input-border);
    box-shadow: none;
    outline: none;
}

.auth-theme-page .pw-toggle {
    border: 1px solid var(--input-border) !important;
    border-left: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    background: #f5f7fa !important;
    color: #232b3a !important;
}

.auth-theme-page .pw-toggle:focus,
.auth-theme-page .pw-toggle:active,
.auth-theme-page .pw-toggle:hover {
    box-shadow: none !important;
    border-color: var(--input-border) !important;
    background: #f5f7fa !important;
    color: #232b3a !important;
}

/* Quick links -- portal switcher badges inside the card */
.quick-links {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 14px;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quick-links::-webkit-scrollbar {
    display: none;
}

.quick-links .qbadge {
    font-size: 0.89rem;
    font-weight: 800;
    border-radius: 10px;
    padding: 0.45em 0.75em;
    box-shadow: 0 10px 26px rgba(0,0,0,0.14);
    text-decoration: none !important;
    transition: transform 0.13s ease, box-shadow 0.13s ease, filter 0.13s ease;
    border: 1px solid rgba(255,255,255,0.14);
    letter-spacing: 0.005em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex: 0 0 auto;
    backdrop-filter: blur(8px);
}

/* Same palette as the buttons/links below -- one color per portal */
.qbadge-home     { background: #2370ff; color: #fff; }
.qbadge-library  { background: #ffd600; color: #232b3a; }
.qbadge-scheduler{ background: #119a5a; color: #fff; }
.qbadge-students { background: #00c0fa; color: #fff; }
.qbadge-parents  { background: #fc5c7d; color: #fff; }

.quick-links .qbadge:hover,
.quick-links .qbadge:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0,0,0,0.18);
    filter: brightness(1.02);
}

@media (max-width: 520px) {
    .login-header {
        margin-top: 4.3rem;
    }

    .quick-links {
        left: 10px;
        right: 10px;
        gap: 0.4rem;
        justify-content: flex-start;
    }

    .quick-links .qbadge {
        font-size: 0.82rem;
        padding: 0.4em 0.66em;
    }
}

/* Primary action button */
.btn-auth {
    background: linear-gradient(90deg, #6a82fb 0%, #fc5c7d 100%);
    border: none;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.02em;
    border-radius: 12px;
    font-size: 1.10rem;
    padding: 0.88rem 1rem;
    width: 100%;
    margin-top: 1.1em;
    box-shadow: 0 14px 34px rgba(106, 130, 251, 0.16);
    transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.btn-auth:hover,
.btn-auth:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 44px rgba(106, 130, 251, 0.22);
    filter: brightness(1.02);
}

.forgot-link {
    color: orange;
    font-size: 1.03em;
    text-decoration: none;
    font-weight: 700;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #fff2b0;
}

.auth-theme-page .footer {
    margin-top: 1.8rem;
    font-weight: 600;
    color: #ddd;
    text-align: center;
    font-size: 1.01rem;
    letter-spacing: 0.01em;
}

.auth-theme-page .footer a {
    color: orange;
    text-decoration: none;
    font-weight: 800;
}

.auth-theme-page .footer a:hover { text-decoration: underline; }

.auth-theme-page .error,
.auth-theme-page .alert-danger,
.auth-theme-page .alert-info {
    padding: 0.8em 1em;
    border-radius: 12px;
    margin-bottom: 1em;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 12px 26px rgba(0,0,0,0.10);
    border: 1px solid rgba(255,255,255,0.12);
}
.auth-theme-page .error,
.auth-theme-page .alert-danger {
    background: #dc3545;
    color: #fff;
}
.auth-theme-page .alert-info {
    background: rgba(35, 43, 58, 0.85);
    color: #fff;
}
.auth-theme-page .alert-danger .btn-close,
.auth-theme-page .alert-info .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1080;
}

.auth-theme-page .toast {
    min-width: 260px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(35, 43, 58, 0.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 45px rgba(0,0,0,0.22);
}

.auth-theme-page .toast .toast-body {
    font-weight: 700;
    color: #fff;
}

/* A11y focus */
.auth-theme-page :where(a, button, .form-check-input):focus-visible {
    outline: 2.5px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

/* Text fields never show a focus ring/outline, on click or keyboard */
.auth-theme-page :where(input, .form-control):focus,
.auth-theme-page :where(input, .form-control):focus-visible {
    outline: none;
    box-shadow: none;
}
