:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-elevated: #1e242c;
    --text-primary: #e8ecf1;
    --text-secondary: #9aa3b2;
    --text-muted: #6b7280;
    --accent: #5fb478;
    --accent-hover: #a5e3bd;
    --accent-deep: #3d7a50;
    --border-color: rgba(255,255,255,0.10);
    --border-soft: rgba(255,255,255,0.06);
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --card-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255,255,255,0.04) inset;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(95,180,120,0.10), transparent 50%),
        radial-gradient(ellipse 80% 60% at 80% 70%, rgba(96,165,250,0.08), transparent 50%),
        linear-gradient(180deg, #0d1117 0%, #161b22 100%);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: auto;
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    overflow: hidden;
    min-height: 700px;
}

.auth-visual {
    flex: 1;
    background:
        radial-gradient(circle at 20% 10%, rgba(255,255,255,0.10), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(0,0,0,0.20), transparent 50%),
        linear-gradient(135deg, #3d7a50 0%, #2f6240 60%, #1f4530 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Branded logo at the top of the visual side */
.auth-logo {
    position: absolute;
    top: 28px;
    left: 28px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 2;
    text-decoration: none;
    color: #ffffff;
}
.auth-logo img {
    width: 38px; height: 38px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.45));
}
.auth-logo-text {
    display: flex; flex-direction: column; line-height: 1.05;
}
.auth-logo-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.30);
}
.auth-logo-tag {
    font-size: 9.5px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Bubble Animation */
.bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: rise var(--duration) infinite ease-in;
}

@keyframes rise {
    0% { bottom: -100px; transform: translateX(0); opacity: 0; }
    20% { opacity: 0.5; }
    80% { opacity: 0.5; }
    100% { bottom: 100%; transform: translateX(var(--move-x)); opacity: 0; }
}

.visual-content {
    position: relative;
    z-index: 1;
}

.auth-visual i {
    font-size: 120px;
    margin-bottom: 30px;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.45));
    color: #ffffff;
}

.auth-visual h2 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.30);
    letter-spacing: -0.4px;
}

.auth-visual p {
    font-size: 17px;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    max-width: 380px;
    margin: 0 auto;
}

.auth-content {
    flex: 1.2;
    padding: 50px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--bg-secondary);
}

.auth-header {
    margin-bottom: 35px;
}

.auth-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    margin-bottom: 22px;
    position: relative;
    flex: 1;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: 2px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    transition: var(--transition);
}

.form-control, .country-select {
    width: 100%;
    padding: 14px 18px 14px 52px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    background-color: rgba(255,255,255,0.04);
    appearance: none;
    font-family: 'DM Sans', sans-serif;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus, .country-select:focus {
    outline: none;
    border-color: rgba(95,180,120,0.55);
    background-color: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 4px rgba(95,180,120,0.15);
}

.form-control:focus ~ .input-icon {
    color: var(--accent);
}

.country-select option {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.password-toggle {
    position: absolute;
    right: 18px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    z-index: 2;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--accent);
}

/* Password Requirements */
.password-requirements {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    transition: var(--transition);
}

.password-requirements.hide {
    display: none;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.requirement-icon {
    font-size: 16px;
}

.requirement-item.met {
    color: var(--success);
}

.password-match-info {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
}

.password-match-info.match { color: var(--success); }
.password-match-info.no-match { color: var(--danger); }

/* Checkbox */
.terms-checkbox {
    margin: 25px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    accent-color: var(--accent);
    margin-top: 2px;
    background: rgba(255,255,255,0.04);
}

.terms-checkbox a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.terms-checkbox a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

/* Button — uses the platform-wide elevated CTA pattern */
.auth-btn {
    position: relative;
    width: 100%;
    padding: 15px 18px;
    background: linear-gradient(180deg, #3d7a50, #2f6240);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s cubic-bezier(0.32,0.72,0,1), box-shadow 0.18s ease, background 0.18s ease;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.45),
        0 0 24px rgba(95,180,120,0.20),
        inset 0 1px 0 rgba(255,255,255,0.10);
    font-family: 'DM Sans', sans-serif;
}

.auth-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    transform: translateX(-110%);
    transition: transform 0.55s ease;
    pointer-events: none;
}

.auth-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #468d5d, #36744a);
    transform: translateY(-2px);
    box-shadow:
        0 14px 32px rgba(0,0,0,0.55),
        0 0 36px rgba(95,180,120,0.40),
        inset 0 1px 0 rgba(255,255,255,0.18);
}
.auth-btn:hover:not(:disabled)::before { transform: translateX(110%); }

.auth-btn:disabled {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border-color: rgba(255,255,255,0.06);
    cursor: not-allowed;
    box-shadow: none;
    text-shadow: none;
}

.auth-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 14.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}
.auth-footer a:hover { color: var(--accent-hover); }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 600;
}

.alert-danger {
    background: rgba(248,113,113,0.10);
    border: 1px solid rgba(248,113,113,0.30);
    color: #fca5a5;
}

.alert-success {
    background: rgba(74,222,128,0.10);
    border: 1px solid rgba(74,222,128,0.30);
    color: #86efac;
}

.alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.alert-box {
    background: linear-gradient(180deg, #1c2229 0%, #14181d 100%);
    border: 1px solid rgba(255,255,255,0.10);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow:
        0 40px 100px rgba(0,0,0,0.75),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 1px 0 rgba(255,255,255,0.06) inset;
    animation: slideUpAlert 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpAlert {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeOutAlert {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-40px) scale(0.95); }
}

.alert-overlay.fade-out .alert-box {
    animation: fadeOutAlert 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.alert-overlay.fade-out {
    animation: fadeOutOverlay 0.4s ease-out forwards;
}

@keyframes fadeOutOverlay {
    from { opacity: 1; }
    to { opacity: 0; }
}

.alert-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: zoomInIcon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--success);
    filter: drop-shadow(0 0 18px rgba(74,222,128,0.45));
}

@keyframes zoomInIcon {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

.alert-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.alert-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.alert-progress {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.alert-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    animation: progressFill 1.5s linear forwards;
    box-shadow: 0 0 12px rgba(95,180,120,0.45);
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Responsive */
@media (max-width: 992px) {
    .auth-card {
        flex-direction: column;
        min-height: auto;
    }
    .auth-visual {
        padding: 40px;
    }
    .auth-logo {
        top: 20px;
        left: 20px;
    }
    .auth-content {
        padding: 40px;
    }
}

@media (max-width: 576px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .auth-content {
        padding: 30px 20px;
    }
    .password-requirements {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SOCIAL LOGIN — dark glass buttons
   ===================================================== */

.social-login-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    font-family: 'DM Sans', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.social-btn:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 8px 22px rgba(0,0,0,0.45);
}

.social-btn__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* ── Google ── */
.social-btn--google:hover {
    border-color: rgba(66,133,244,0.45);
    background: rgba(66,133,244,0.08);
    box-shadow: 0 8px 22px rgba(66,133,244,0.20);
}

/* ── Facebook ── */
.social-btn--facebook:hover {
    border-color: rgba(24,119,242,0.45);
    background: rgba(24,119,242,0.08);
    box-shadow: 0 8px 22px rgba(24,119,242,0.20);
}

/* ── Apple ── */
.social-btn--apple {
    color: var(--text-primary);
}

.social-btn--apple:hover {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 8px 22px rgba(0,0,0,0.55);
}

/* ── Loading state ── */
.social-btn--loading {
    pointer-events: none;
    opacity: 0.7;
}

.social-btn--loading span {
    opacity: 0;
}

.social-btn--loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.20);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: socialSpinner 0.6s linear infinite;
}

@keyframes socialSpinner {
    to { transform: rotate(360deg); }
}

/* ─── Divider ─── */
.social-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.social-divider span {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: lowercase;
    letter-spacing: 0.3px;
}

/* ─── Responsive ─── */
@media (max-width: 576px) {
    .social-login-group {
        gap: 10px;
    }
    .social-btn {
        padding: 12px 16px;
        font-size: 13.5px;
    }
}

/* =====================================================
   THEME TOGGLE BUTTON  (works in both themes)
   ===================================================== */
.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1100;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.16);
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: transform .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.auth-theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

/* =====================================================
   LIGHT THEME — toggled via <html class="theme-light">.
   Scoped to the auth screens (they load auth.css). The
   green brand/visual panel stays the same in both themes.
   ===================================================== */
html.theme-light {
    --bg-primary:    #eef2f7;
    --bg-secondary:  #ffffff;
    --bg-elevated:   #ffffff;
    --text-primary:  #18212e;
    --text-secondary:#56606e;
    --text-muted:    #8a94a2;
    --border-color:  rgba(16,32,56,0.12);
    --border-soft:   rgba(16,32,56,0.06);
    --card-shadow:   0 24px 60px rgba(20,40,80,0.14), 0 0 0 1px rgba(16,32,56,0.05) inset;
}
html.theme-light body {
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(95,180,120,0.12), transparent 50%),
        radial-gradient(ellipse 80% 60% at 80% 70%, rgba(96,165,250,0.10), transparent 50%),
        linear-gradient(180deg, #eef2f7 0%, #e4eaf2 100%);
}
html.theme-light .auth-card { border-color: rgba(16,32,56,0.08); }
html.theme-light .form-control,
html.theme-light .country-select { background: #f3f6fa; border-color: rgba(16,32,56,0.12); }
html.theme-light .form-control::placeholder { color: #9aa4b2; }
html.theme-light .form-control:focus,
html.theme-light .country-select:focus {
    background: #ffffff;
    border-color: rgba(95,180,120,0.55);
    box-shadow: 0 0 0 4px rgba(95,180,120,0.15);
}
html.theme-light .country-select option { background: #ffffff; color: var(--text-primary); }
html.theme-light .password-requirements { background: #f3f6fa; border-color: rgba(16,32,56,0.08); }
html.theme-light .terms-checkbox input[type="checkbox"] { background: #f3f6fa; border-color: rgba(16,32,56,0.25); }
html.theme-light .social-btn { background: #f3f6fa; border-color: rgba(16,32,56,0.12); }
html.theme-light .social-divider::before,
html.theme-light .social-divider::after { background: rgba(16,32,56,0.10); }
html.theme-light .alert-box {
    background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%);
    border-color: rgba(16,32,56,0.10);
}
html.theme-light .auth-theme-toggle {
    background: rgba(16,32,56,0.04);
    border-color: rgba(16,32,56,0.12);
    box-shadow: 0 4px 14px rgba(20,40,80,0.08);
}
