/* ============================================================
   EduMarkets — Auth Pages (Login, Register)
   Matches the institutional Streamlit auth design.
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111114;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}



.auth-container {
    width: 100%;
    max-width: 440px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: authFadeUp 0.6s ease-out;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo {
    margin-bottom: 56px;
    text-align: center;
}

.auth-logo img {
    max-width: 320px;
    width: 100%;
    height: auto;
    filter: brightness(1.05);
}

.auth-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 44px 40px;
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 20px 60px -10px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 440px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    color: #f0f0f0;
    text-align: center;
}

.auth-card .auth-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.45);
    font-weight: 300;
    margin-bottom: 20px;
    text-align: center;
}

.auth-field {
    margin-bottom: 20px;
    text-align: left;
}

.auth-field label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.auth-field input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.auth-field input:focus {
    border-color: rgba(59,130,246,0.4);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.auth-field input::placeholder {
    color: rgba(255,255,255,0.25);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
    color: #0B0B0C;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    letter-spacing: -0.2px;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.1);
}

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

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

.auth-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #e0e0e0;
}

.auth-btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    box-shadow: none;
}

[data-theme="light"] .auth-btn-secondary {
    background: transparent;
    border: 1px solid rgba(27,58,92,0.25);
    color: #1B3A5C;
}

[data-theme="light"] .auth-btn-secondary:hover {
    background: rgba(27,58,92,0.05);
    box-shadow: none;
}

.auth-error {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.15);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: left;
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-info {
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.1);
    color: rgba(147,197,253,0.9);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: left;
    display: none;
}

.auth-info.visible {
    display: block;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 4px;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: rgba(255,255,255,0.8);
    cursor: pointer;
}

.auth-forgot-link {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-forgot-link:hover {
    color: rgba(255,255,255,0.8);
}

.auth-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.auth-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: rgba(255,255,255,0.8);
}

.auth-footer p + p {
    margin-top: 8px;
}

.auth-page-footer {
    margin-top: 32px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.auth-page-footer a {
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-page-footer a:hover {
    color: rgba(255,255,255,0.7);
}

.auth-page-footer-dot {
    opacity: 0.4;
}

/* ============================================================
   Light Mode Overrides
   ============================================================ */

[data-theme="light"] .auth-page {
    background: #f0f2f7;
}



[data-theme="light"] .auth-logo img {
    content: url('/assets/EduMarkets_black_text.png');
}

[data-theme="light"] .auth-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.65) 100%);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.03),
        0 20px 60px -10px rgba(0,0,0,0.12);
}

[data-theme="light"] .auth-card h1 {
    color: #1B3A5C;
}

[data-theme="light"] .auth-card .auth-subtitle {
    color: rgba(0,0,0,0.5);
}

[data-theme="light"] .auth-field label {
    color: rgba(0,0,0,0.55);
}

[data-theme="light"] .auth-field input {
    background: #f4f6fa;
    border: 1px solid #dde1ec;
    color: #1B3A5C;
}

[data-theme="light"] .auth-field input:focus {
    border-color: rgba(59,130,246,0.5);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

[data-theme="light"] .auth-field input::placeholder {
    color: rgba(0,0,0,0.3);
}

[data-theme="light"] .auth-btn {
    background: linear-gradient(135deg, #1B3A5C 0%, #2E6DA4 100%);
    color: #ffffff;
}

[data-theme="light"] .auth-btn:hover {
    box-shadow: 0 8px 30px rgba(27,58,92,0.25);
}

[data-theme="light"] .auth-error {
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.2);
    color: #dc2626;
}

[data-theme="light"] .auth-info {
    background: rgba(59,130,246,0.06);
    border: 1px solid rgba(59,130,246,0.15);
    color: #2563eb;
}

[data-theme="light"] .auth-checkbox-label {
    color: rgba(0,0,0,0.55);
}

[data-theme="light"] .auth-checkbox-label input[type="checkbox"] {
    accent-color: #2E6DA4;
}

[data-theme="light"] .auth-forgot-link {
    color: rgba(0,0,0,0.5);
}

[data-theme="light"] .auth-forgot-link:hover {
    color: rgba(0,0,0,0.75);
}

[data-theme="light"] .auth-footer {
    color: rgba(0,0,0,0.45);
}

[data-theme="light"] .auth-footer a {
    color: rgba(0,0,0,0.6);
}

[data-theme="light"] .auth-footer a:hover {
    color: rgba(0,0,0,0.8);
}

[data-theme="light"] .auth-page-footer {
    color: rgba(0,0,0,0.35);
}

[data-theme="light"] .auth-page-footer a {
    color: rgba(0,0,0,0.45);
}

[data-theme="light"] .auth-page-footer a:hover {
    color: rgba(0,0,0,0.7);
}

[data-theme="light"] .auth-page-footer-dot {
    opacity: 0.35;
}

/* ============================================================
   Password toggle, checklist, strength meter, confirm match
   ============================================================ */

.auth-field-wrap {
    position: relative;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(255,255,255,0.35);
    transition: color 0.2s;
    line-height: 0;
}

.pw-toggle:hover {
    color: rgba(255,255,255,0.7);
}

[data-theme="light"] .pw-toggle {
    color: rgba(0,0,0,0.3);
}

[data-theme="light"] .pw-toggle:hover {
    color: rgba(0,0,0,0.6);
}

.password-checklist {
    margin-top: 8px;
    margin-bottom: 12px;
}

.pw-rule {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    padding: 2px 0;
    transition: color 0.2s;
}

.pw-rule .pw-icon {
    display: inline-block;
    width: 16px;
    font-weight: 600;
}

.pw-rule.met {
    color: #22c55e;
}

[data-theme="light"] .pw-rule {
    color: rgba(0,0,0,0.35);
}

[data-theme="light"] .pw-rule.met {
    color: #16a34a;
}

.pw-strength-bar {
    margin-top: 8px;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    position: relative;
    overflow: visible;
}

.pw-strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.pw-strength-label {
    position: absolute;
    right: 0;
    top: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: color 0.3s;
}

[data-theme="light"] .pw-strength-bar {
    background: rgba(0,0,0,0.06);
}

.pw-match {
    font-size: 0.78rem;
    margin-top: 4px;
    min-height: 1.2em;
}

.match-ok {
    color: #22c55e;
}

.match-fail {
    color: #ef4444;
}

[data-theme="light"] .match-ok {
    color: #16a34a;
}

[data-theme="light"] .match-fail {
    color: #dc2626;
}

/* ============================================================
   Account page — Danger Zone
   ============================================================ */

.account-danger-zone {
    border: 1px solid rgba(220,38,38,0.2) !important;
}

.danger-zone-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.danger-zone-toggle:hover {
    color: #f87171;
}

.danger-chevron {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.danger-zone-toggle[aria-expanded="true"] .danger-chevron {
    transform: rotate(180deg);
}

[data-theme="light"] .account-danger-zone {
    border-color: rgba(220,38,38,0.25) !important;
}

[data-theme="light"] .danger-zone-toggle {
    color: #dc2626;
}

[data-theme="light"] .danger-zone-toggle:hover {
    color: #ef4444;
}

/* Account page card headings */
.auth-card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #f0f0f0;
}

[data-theme="light"] .auth-card h2 {
    color: #1B3A5C;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-card { padding: 32px 24px; }
    .auth-logo img { max-width: 260px; }
    .auth-logo { margin-bottom: 40px; }
}
