/* =============================================
   FamoraLearn - Login Page (Mobile-First Fix)
   ============================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    position: relative;
}

/* Decorative blobs — pointer-events off, no overflow */
body::before {
    content: '';
    position: fixed;
    width: 400px; height: 400px;
    background: radial-gradient(circle, var(--float-color) 0%, transparent 70%);
    top: -150px; right: -150px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    width: 350px; height: 350px;
    background: radial-gradient(circle, var(--float-color) 0%, transparent 70%);
    bottom: -120px; left: -120px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Theme toggle */
.theme-toggle-fixed {
    position: fixed;
    top: 16px; right: 16px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 7px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Mono', monospace;
    font-size: 0.78em;
    color: var(--text);
    z-index: 1000;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}
.theme-toggle-fixed:hover { border-color: var(--light); }

/* Page wrapper */
.login-page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 72px 16px 32px;
}

/* Login card */
.login-container {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 44px 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    animation: slideUp 0.5s ease-out;
}

/* Logo */
.brand-logo-img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 50%;
    background: #000;
    display: block;
    margin: 0 auto;
    border: 3px solid rgba(246,177,122,0.4);
    box-shadow: 0 4px 20px rgba(246,177,122,0.2);
}

.logo-title {
    font-family: 'Space Mono', monospace;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--light);
    letter-spacing: -2px;
    margin-bottom: 2px;
    line-height: 1;
}

.logo-sub {
    color: var(--text-muted, rgba(232,233,243,0.5));
    font-size: 0.72em;
    letter-spacing: 3px;
    margin-top: 4px;
}

/* Labels */
.custom-label {
    color: var(--text);
    font-weight: 600;
    font-size: 0.88em;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
    display: block;
}

/* Inputs */
.custom-input {
    background: var(--input-bg) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 12px !important;
    color: var(--text) !important;
    font-family: 'Crimson Pro', serif;
    font-size: 1.05em;
    padding: 13px 16px;
    transition: all 0.25s;
    box-shadow: none !important;
    width: 100%;
}
.custom-input::placeholder { color: var(--text-muted, rgba(232,233,243,0.4)); font-style: italic; }
.custom-input:focus {
    border-color: var(--light) !important;
    box-shadow: 0 0 0 3px rgba(246,177,122,0.15) !important;
}
.custom-input:-webkit-autofill,
.custom-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Input group — password + eye button */
.input-group .custom-input {
    border-radius: 12px 0 0 12px !important;
    border-right: none !important;
}
.custom-eye-btn {
    background: var(--input-bg) !important;
    border: 1.5px solid var(--border) !important;
    border-left: none !important;
    border-radius: 0 12px 12px 0 !important;
    color: var(--text-muted, rgba(232,233,243,0.5)) !important;
    padding: 0 14px;
    font-size: 1em;
    cursor: pointer;
    transition: color 0.2s;
    flex-shrink: 0;
}
.custom-eye-btn:hover { color: var(--light) !important; }
.input-group:focus-within .custom-input,
.input-group:focus-within .custom-eye-btn {
    border-color: var(--light) !important;
}

/* Buttons */
.btn-custom-primary {
    background: linear-gradient(135deg, #F6B17A 0%, #e07b2a 100%);
    color: #1a1d2e;
    border: none;
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.92em;
    letter-spacing: 1px;
    padding: 14px;
    transition: all 0.3s;
    display: block;
    width: 100%;
    text-align: center;
}
.btn-custom-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(246,177,122,0.4);
    color: #1a1d2e;
}

.btn-custom-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 0.92em;
    letter-spacing: 1px;
    padding: 13px;
    transition: all 0.3s;
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}
.btn-custom-outline:hover {
    background: var(--light);
    border-color: var(--light);
    color: #1a1d2e;
}

/* Divider */
.divider { text-align: center; position: relative; margin: 20px 0; }
.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%; width: 42%; height: 1px;
    background: var(--border);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }
.divider span { padding: 0 14px; color: var(--text-muted, rgba(232,233,243,0.4)); font-size: 0.82em; letter-spacing: 2px; }

/* Alert */
.alert-danger {
    background: rgba(255,82,82,0.12);
    border: 1px solid rgba(255,82,82,0.35);
    color: #ff7a7a;
    border-radius: 10px;
    font-size: 0.9em;
    padding: 10px 14px;
}

.footer-note { color: var(--text-muted, rgba(232,233,243,0.4)); font-size: 0.78em; margin: 0; }

/* ---- MOBILE RESPONSIVE ---- */
@media (max-width: 480px) {
    .login-page-wrap { padding: 64px 12px 24px; align-items: flex-start; }
    .login-container { padding: 32px 22px; border-radius: 20px; }
    .logo-title { font-size: 1.8em; }
    .brand-logo-img { width: 68px; height: 68px; }
}

/* ---- LIGHT MODE ---- */
[data-theme="light"] .login-container { box-shadow: 0 24px 70px rgba(0,0,0,0.1); }
[data-theme="light"] .custom-label { color: #1a202c; }
[data-theme="light"] .custom-input { border-color: #cbd5e0 !important; color: #1a202c !important; background: #fff !important; }
[data-theme="light"] .custom-input::placeholder { color: #a0aec0; opacity: 1; }
[data-theme="light"] .custom-eye-btn { border-color: #cbd5e0 !important; background: #fff !important; color: #a0aec0 !important; }
[data-theme="light"] .btn-custom-outline { border-color: #cbd5e0; color: #2d3748; }
[data-theme="light"] .divider span { color: #a0aec0; }
[data-theme="light"] .footer-note { color: #a0aec0; }
[data-theme="light"] .logo-sub { color: #718096; }
