/* ==========================================================================
   ARIVU - Legal Compliance, Cookie Consent & Google Authentication Styles
   Matches the warm editorial notebook aesthetic of Arivu
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Google Auth & User Profile Navigation
   -------------------------------------------------------------------------- */
.nav-auth {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin-left: 0.25rem;
}

.auth-btn-signin {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.78rem 0.42rem 0.55rem;
    background: color-mix(in srgb, var(--paper) 72%, transparent);
    color: var(--ink);
    border: 1.5px solid var(--border-2);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(38, 31, 20, 0.06);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.auth-btn-signin:hover {
    background: var(--paper-2);
    border-color: var(--ink-3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 31, 20, 0.1);
}

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

.auth-btn-signin svg {
    flex-shrink: 0;
    padding: 3px;
    box-sizing: content-box;
    border: 1px solid var(--border-2);
    border-radius: 50%;
    background: var(--paper-2);
}

.auth-btn-signin:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Logged-in User Profile Pill */
.user-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.65rem 0.3rem 0.35rem;
    background: var(--paper-2);
    border: 1.5px solid var(--border-2);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.user-profile-pill:hover,
.user-profile-pill:focus-visible {
    border-color: var(--ink);
    background: var(--paper-3);
    outline: none;
}

.user-avatar-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-2);
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.user-name-label {
    font-family: var(--sans);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pill-arrow {
    font-size: 0.65rem;
    color: var(--ink-3);
    transition: transform 0.2s ease;
}

.user-profile-pill.active .user-pill-arrow {
    transform: rotate(180deg);
}

/* User Profile Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 10px;
    height: 10px;
    background: var(--paper);
    border-left: 1.5px solid var(--ink);
    border-top: 1.5px solid var(--ink);
    transform: rotate(45deg);
    z-index: 1;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@media (max-width: 480px) {
    .user-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
        transform: translateY(100%);
        border-bottom: none;
    }
    .user-dropdown-menu::before {
        display: none;
    }
    .user-dropdown-menu.show {
        transform: translateY(0);
    }
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border-2);
    margin-bottom: 0.75rem;
}

.user-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.user-dropdown-details {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-email {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(62, 112, 80, 0.15);
    color: var(--sage);
}

.user-dropdown-stats {
    background: var(--paper-2);
    border-radius: var(--radius-md, 8px);
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-family: var(--sans);
}

.user-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 6px);
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.user-dropdown-btn:hover {
    background: var(--paper-2);
}

.user-dropdown-btn svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.user-dropdown-btn:hover svg {
    opacity: 1;
}

.user-dropdown-badge svg {
    flex-shrink: 0;
}

.user-dropdown-btn.danger {
    color: var(--accent);
}

.user-dropdown-btn.danger:hover {
    background: rgba(200, 52, 42, 0.08);
}

/* --------------------------------------------------------------------------
   2. Cookie Consent Banner (Bottom-Right / Floating)
   -------------------------------------------------------------------------- */
.cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    max-width: 440px;
    width: calc(100% - 3rem);
    background: var(--paper);
    background-image: var(--ruled-lines), var(--texture-paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
    padding: 1.4rem;
    z-index: 850;
    transform: translateY(120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-banner-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.cookie-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    line-height: 1;
    flex-shrink: 0;
}

.cookie-icon svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
}

.cookie-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.cookie-text {
    font-family: var(--sans);
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--ink-2);
    margin-bottom: 1rem;
}

.cookie-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cookie-btn-accept {
    flex: 1;
    min-width: 110px;
    padding: 0.55rem 0.85rem;
    background: var(--accent);
    color: var(--paper);
    border: 1.5px solid var(--accent);
    border-radius: var(--radius-md, 8px);
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cookie-btn-accept:hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
}

.cookie-btn-reject {
    flex: 1;
    min-width: 110px;
    padding: 0.55rem 0.85rem;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-md, 8px);
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cookie-btn-reject:hover {
    background: var(--paper-2);
    border-color: var(--ink);
}

.cookie-btn-prefs {
    width: 100%;
    padding: 0.4rem;
    background: transparent;
    color: var(--ink-3);
    border: none;
    font-family: var(--sans);
    font-size: 0.78rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    text-align: center;
}

.cookie-btn-prefs:hover {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   3. Comprehensive Legal & Compliance Modals
   -------------------------------------------------------------------------- */
.legal-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 14, 12, 0.65);
    backdrop-filter: blur(5px);
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* The author `display: flex` above overrides the browser's default hidden rule. */
.legal-modal-backdrop[hidden] {
    display: none;
}

.legal-modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.legal-modal-container {
    background: var(--paper);
    background-image: var(--ruled-lines), var(--texture-paper);
    border: 2px solid var(--ink);
    border-radius: var(--radius-lg, 12px);
    max-width: 760px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.legal-modal-backdrop.show .legal-modal-container {
    transform: translateY(0) scale(1);
}

.legal-modal-header {
    padding: 1.5rem 1.75rem 1rem 1.75rem;
    border-bottom: 1.5px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper-2);
}

.legal-modal-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.legal-badge-pill {
    align-self: flex-start;
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(200, 52, 42, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(200, 52, 42, 0.2);
}

.legal-modal-title {
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.legal-modal-subtitle {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-3);
}

.legal-modal-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-3);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.legal-modal-close:hover {
    background: var(--accent);
    color: var(--paper);
    border-color: var(--accent);
}

.legal-modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    font-family: var(--sans);
    font-size: 0.88rem;
    line-height: 1.68;
    color: var(--ink);
    scroll-behavior: smooth;
}

/* Callout Box inside Legal Content */
.legal-callout {
    background: rgba(232, 183, 58, 0.15);
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
    padding: 0.85rem 1.15rem;
    margin: 1.15rem 0;
    font-size: 0.84rem;
}

.legal-callout.alert {
    background: rgba(200, 52, 42, 0.1);
    border-left-color: var(--accent);
}

.legal-callout.success {
    background: rgba(62, 112, 80, 0.1);
    border-left-color: var(--sage);
}

.legal-callout-title {
    font-family: var(--sans);
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-callout-title svg {
    flex-shrink: 0;
}

.legal-section-h2 {
    font-family: var(--serif);
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--ink);
    margin: 1.4rem 0 0.5rem 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed var(--border-2);
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.8rem;
}

.legal-table th,
.legal-table td {
    border: 1px solid var(--border-2);
    padding: 0.55rem 0.75rem;
    text-align: left;
}

.legal-table th {
    background: var(--paper-2);
    font-weight: 600;
    color: var(--ink);
}

.legal-modal-footer {
    padding: 1rem 1.75rem;
    border-top: 1.5px solid var(--border-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--paper-2);
    gap: 1rem;
}

.legal-footer-note {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   4. Cookie Preferences Category Toggles
   -------------------------------------------------------------------------- */
.cookie-pref-group {
    background: var(--paper-2);
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-md, 8px);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.cookie-pref-group:hover {
    border-color: var(--ink-3);
}

.cookie-pref-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.cookie-pref-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ink);
}

.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--border-2);
    transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
    background-color: var(--accent);
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(20px);
}

.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--sage);
}

.cookie-pref-desc {
    font-family: var(--sans);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--ink-3);
    margin: 0;
}

/* --------------------------------------------------------------------------
   5. Google Sign-In & Auth Modal Styling
   -------------------------------------------------------------------------- */
.auth-dialog-card {
    text-align: center;
    padding: 1.5rem clamp(1rem, 4vw, 2rem);
}

#auth-modal .legal-modal-container {
    width: min(480px, calc(100vw - 2rem));
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(23, 19, 13, 0.28);
}

#auth-modal .legal-modal-header {
    padding: 1.25rem 1.5rem;
}

#auth-modal .legal-modal-body > p {
    max-width: 36rem;
    margin: 0 auto 1rem;
    line-height: 1.65;
}

#auth-modal .auth-gis-wrapper {
    min-height: 52px;
    margin: 1rem 0 1.1rem;
}

#auth-modal .auth-divider {
    margin: 1rem 0;
    color: var(--ink-3);
}

#auth-modal .student-signin-form {
    gap: 0.75rem;
    padding: 1.1rem;
    border-radius: 12px;
    background: var(--paper-2);
}

/* Keep the sign-in form visually continuous with the paper modal. */
.auth-dialog-card .student-signin-form {
    background: transparent;
    border-color: var(--border-2);
}

.auth-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--paper-2);
    border: 2px solid var(--border-2);
    margin-bottom: 1rem;
}

.auth-gis-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    margin: 1.25rem 0;
}

.auth-divider-line {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--ink-4);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.auth-divider-line::before,
.auth-divider-line::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed var(--border-2);
}

.auth-divider-line:not(:empty)::before {
    margin-right: 0.75rem;
}

.auth-divider-line:not(:empty)::after {
    margin-left: 0.75rem;
}

.auth-demo-btn {
    width: 100%;
    max-width: 320px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.65rem 1.2rem;
    background: var(--paper-2);
    border: 1.5px dashed var(--ink-3);
    border-radius: var(--radius-md, 8px);
    font-family: var(--sans);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-demo-btn:hover {
    background: var(--paper-3);
    border-color: var(--ink);
    border-style: solid;
}

.auth-client-id-config {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--paper-2);
    border-radius: var(--radius-md, 8px);
    font-size: 0.78rem;
    text-align: left;
}

.auth-client-id-config summary {
    font-family: var(--mono);
    cursor: pointer;
    color: var(--ink-3);
    font-weight: 600;
}

.auth-client-id-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.auth-client-id-input {
    flex: 1;
    padding: 0.4rem 0.65rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm, 4px);
    background: var(--paper);
    color: var(--ink);
}

.auth-client-id-save {
    padding: 0.4rem 0.75rem;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: var(--radius-sm, 4px);
    font-size: 0.75rem;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. Dark Mode Adaptations
   -------------------------------------------------------------------------- */
html.dark .auth-btn-signin {
    background: transparent;
    color: var(--ink);
    border-color: var(--border-2);
}

html.dark .auth-btn-signin:hover {
    background: var(--paper-2);
    border-color: var(--border-2);
}

html.dark .cookie-banner {
    background: #1e1b15;
    border-color: #4a4030;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

html.dark .legal-modal-container {
    background: #181611;
    border-color: #4a4030;
}

html.dark .legal-modal-header,
html.dark .legal-modal-footer,
html.dark .cookie-pref-group,
html.dark .legal-table th {
    background: #232019;
}

html.dark .user-dropdown-menu {
    background: #1c1a14;
    border-color: #4a4030;
}

html.dark .user-dropdown-stats {
    background: #232019;
}

html.dark .user-dropdown-btn:hover {
    background: #28241c;
}

/* --------------------------------------------------------------------------
   7. Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .cookie-banner {
        bottom: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        padding: 1rem;
    }

    .legal-modal-container {
        max-height: 94vh;
    }

    .legal-modal-header,
    .legal-modal-body,
    .legal-modal-footer {
        padding: 1rem 1.2rem;
    }

    .user-name-label {
        display: none;
    }
}

/* ==========================================================================
   8. Modern Startup Components & Features
   ========================================================================== */

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0 1rem;
    color: var(--ink-4);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px dashed var(--border-2, #dccca5);
}
.auth-divider span {
    padding: 0 0.75rem;
}

/* Student Quick Sign-in Form */
.student-signin-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: var(--paper-2);
    padding: 1rem;
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-2);
}
.auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.auth-form-row {
    display: flex;
    gap: 0.75rem;
}
.auth-label {
    font-family: var(--sans);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--ink-2);
    letter-spacing: 0.02em;
}
.auth-input,
.auth-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-family: var(--sans);
    font-size: 0.86rem;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.auth-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5e4b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 16px;
    cursor: pointer;
    line-height: 1.4;
}
.auth-select:hover {
    border-color: var(--ink-3);
}
.auth-select option {
    padding: 0.5rem;
    background: var(--paper);
    color: var(--ink);
}
html.dark .auth-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a89a7e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.auth-input:focus,
.auth-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 52, 42, 0.15);
}
.auth-btn-student-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(200, 52, 42, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-btn-student-submit:hover {
    background: var(--accent-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(200, 52, 42, 0.35);
}
.auth-btn-student-submit:active {
    transform: translateY(0);
}

/* Admin / Config helper */
.auth-admin-details {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(232, 183, 58, 0.1);
    border: 1px dashed var(--gold);
    border-radius: 6px;
    font-size: 0.78rem;
}
.auth-admin-summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink-2);
    user-select: none;
}
.auth-admin-content {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(232, 183, 58, 0.25);
}
.auth-btn-secondary {
    background: var(--paper-3);
    color: var(--ink);
    border: 1px solid var(--border-2);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}
.auth-btn-secondary:hover {
    background: var(--paper-4);
    border-color: var(--ink);
}

/* Saved Pathways Modal & Drawer */
.saved-pathways-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}
.saved-pathway-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    background: var(--paper-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.saved-pathway-card:hover {
    border-color: var(--accent);
    transform: translateX(2px);
}
.saved-pathway-info {
    flex: 1;
}
.saved-pathway-title {
    font-family: var(--serif, serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}
.saved-pathway-meta {
    font-size: 0.78rem;
    color: var(--ink-3);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.saved-pathway-tag {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(200, 52, 42, 0.1);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.72rem;
}
.saved-pathway-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.saved-pathway-remove-btn {
    background: transparent;
    border: none;
    color: var(--ink-4);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.saved-pathway-remove-btn:hover {
    color: var(--accent);
    background: rgba(200, 52, 42, 0.1);
}

/* Exam Countdown Grid */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}
.exam-card {
    background: var(--paper-2);
    border: 1.5px solid var(--border-2);
    border-radius: 10px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    position: relative;
    transition: all 0.25s ease;
}
.exam-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.exam-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.exam-card-title {
    font-family: var(--serif, serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}
.exam-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
}
.exam-card-desc {
    font-size: 0.8rem;
    color: var(--ink-3);
    line-height: 1.4;
    margin: 0;
}
.exam-countdown-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.65rem;
    background: rgba(232, 183, 58, 0.18);
    color: var(--ink);
    font-family: var(--mono, monospace);
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 6px;
    border: 1px solid var(--gold);
}
.exam-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}
.exam-link-btn:hover {
    border-color: var(--ink);
    background: var(--paper-3);
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 9980;
    background: var(--paper);
    border: 2px solid var(--border-2);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    padding: 0.85rem 1.15rem;
    display: none;
    align-items: center;
    gap: 1rem;
    max-width: 360px;
    animation: slideUpPwa 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.pwa-install-banner.show {
    display: flex;
}
@keyframes slideUpPwa {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.pwa-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}
.pwa-banner-text {
    flex: 1;
}
.pwa-banner-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.15rem 0;
}
.pwa-banner-desc {
    font-size: 0.74rem;
    color: var(--ink-3);
    margin: 0;
    line-height: 1.3;
}
.pwa-btn-install {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pwa-btn-install:hover {
    background: var(--accent-2);
}
.pwa-btn-dismiss {
    background: transparent;
    border: none;
    color: var(--ink-4);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem;
}

/* Mentor / Feedback Modal styles */
.mentor-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.75rem;
}
.mentor-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.65rem 0.75rem;
    font-family: var(--sans);
    font-size: 0.86rem;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    resize: vertical;
    box-sizing: border-box;
}
.mentor-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(200, 52, 42, 0.15);
}

/* Dark Mode Overrides for Startup Components */
html.dark .student-signin-form,
html.dark .saved-pathway-card,
html.dark .exam-card {
    background: #232019;
    border-color: #4a4030;
}
html.dark .pwa-install-banner {
    background: #1e1b15;
    border-color: #4a4030;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}
html.dark .auth-input,
html.dark .auth-select,
html.dark .mentor-textarea {
    background: #181611;
    color: #f5ecd6;
    border-color: #4a4030;
}
html.dark .exam-link-btn,
html.dark .auth-btn-secondary {
    background: #232019;
    color: #f5ecd6;
    border-color: #4a4030;
}
