/* ─── Login page – strictly B/W/grey palette, zero blue/cyan ─── */

:root {
    --bg-dark:     #0f0f0f;
    --bg-card:     #161618;
    --text-primary:   #ececec;
    --text-secondary: #888888;
    --accent:      #3a3a3a;
    --accent-hover:#4a4a4a;
    --border-color: rgba(255, 255, 255, 0.08);
    --error-color: #ef4444;
    --success-color: #10b981;
}

body.light-mode {
    --bg-dark:     #ebebeb;
    --bg-card:     #ffffff;
    --text-primary:   #111111;
    --text-secondary: #666666;
    --accent:      #d0d0d0;
    --accent-hover:#b8b8b8;
    --border-color: rgba(0, 0, 0, 0.10);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f0f0f;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

body.light-mode {
    background: #f0f0f0;
}

/* ── Layout shell ──────────────────────────────── */
.login-shell {
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: 34% 66%;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Kill ALL pseudo-elements that used to carry the blue border */
.login-shell::before,
.login-shell::after,
body::after {
    display: none !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05), transparent 45%),
                radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.03), transparent 40%);
    filter: blur(4px);
    display: block !important;
}

body.light-mode::before {
    background: radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.05), transparent 45%),
                radial-gradient(circle at 15% 85%, rgba(0, 0, 0, 0.03), transparent 40%);
    filter: blur(4px);
    display: block !important;
}

/* ── Brand (left) panel ────────────────────────── */
.brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px;
    position: relative;
    overflow: hidden;
    background: #2a2927;
}

.brand-panel::before,
.brand-panel::after {
    display: none !important;
}

body.light-mode .brand-panel {
    background: #f3f0e9;
}

.brand-content {
    width: 100%;
    max-width: 560px;
    position: relative;
    z-index: 1;
}

.brand-logo {
    width: 164px;
    height: 164px;
    margin-bottom: 18px;
    border-radius: 50%;
    object-fit: cover;
    animation: logoFloat 4s ease-in-out infinite;
}

.logo-white {
    display: block !important;
}

.logo-black {
    display: none !important;
}

body.light-mode .logo-white {
    display: block !important;
}

body.light-mode .logo-black {
    display: none !important;
}

.brand-title {
    font-size: clamp(38px, 5.6vw, 72px);
    letter-spacing: -0.02em;
    line-height: 0.95;
    margin-bottom: 14px;
    color: #f0f0f0;
}

body.light-mode .brand-title {
    color: #111111;
}

.brand-subtitle {
    color: #888888;
    font-size: 18px;
    margin-bottom: 34px;
}

body.light-mode .brand-subtitle {
    color: #555555;
}

.brand-quote {
    font-family: 'Cormorant Garamond', serif;
    font-size: 27px;
    line-height: 1.32;
    letter-spacing: -0.01em;
    transition: opacity 0.18s ease;
    color: #cccccc;
    max-width: 520px;
    min-height: 108px;
}

body.light-mode .brand-quote {
    color: #333333;
}

.brand-quote.is-fading {
    opacity: 0.12;
}

/* ── Auth (right) panel ────────────────────────── */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 28px;
    background: #0f0f0f;
}

body.light-mode .auth-panel {
    background: #f0f0f0;
}

.login-container {
    width: 100%;
    max-width: 620px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 34px 34px 30px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
    position: relative;
    max-width: 560px;
    width: 100%;
    min-height: min(760px, calc(100vh - 90px));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ── Logo / title ──────────────────────────────── */
.logo-section {
    text-align: center;
    margin-bottom: 24px;
}

.logo-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 10px;
    display: block;
    border-radius: 50%;
    object-fit: cover;
}

.logo-section h1 {
    font-size: 32px;
    letter-spacing: -0.02em;
    font-weight: 600;
    margin-bottom: 6px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Sign-in / Sign-up tab switcher ────────────── */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 4px;
    border-radius: 0;
    position: relative;
}

.tab-pill {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 8px);
    height: calc(100% - 8px);
    background: #727983;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    border-radius: 0;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}

.auth-tabs.on-signup .tab-pill {
    left: calc(50% + 4px);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    z-index: 1;
}

.tab-btn.active {
    color: #ffffff;
    font-weight: 600;
}

body.light-mode .auth-tabs {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .tab-pill {
    background: #8b929c;
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ── Google button ─────────────────────────────── */
.google-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.google-btn:hover {
    background: var(--accent-hover);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* ── Divider ───────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 12px;
}

/* ── Forms ─────────────────────────────────────── */
.auth-form {
    display: none;
    opacity: 1;
    pointer-events: none;
}

.auth-form.active {
    display: block;
    pointer-events: auto;
}

#signupForm.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 0;
}

#signupForm .form-group:nth-of-type(1),
#signupForm .error-message,
#signupForm .submit-btn {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
}

body.light-mode .form-group input[type="email"],
body.light-mode .form-group input[type="password"],
body.light-mode .form-group input[type="text"] {
    background: rgba(0, 0, 0, 0.04);
}

body.light-mode .form-group input:focus {
    border-color: rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.07);
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    z-index: 4;
}

.eye-icon {
    width: 20px;
    height: 20px;
}

/* ── Error message ─────────────────────────────── */
.error-message {
    color: var(--error-color);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.12);
    border-radius: 12px;
    display: none;
}

.error-message.show {
    display: block;
}

/* ── Submit button ─────────────────────────────── */
.submit-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:hover {
    background: var(--accent-hover);
}

.submit-btn:active {
    transform: scale(0.996);
}

.kronos-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.forge-icon {
    width: 54px;
    height: 26px;
}

.forge-icon .hammer-handle,
.forge-icon .hammer-head,
.forge-icon .anvil-base,
.forge-icon .anvil-top,
.forge-icon .anvil-neck,
.forge-icon .spark {
    fill: currentColor;
}

/* ── Light/dark toggle (top-right of login card) ── */
.theme-toggle-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.theme-toggle-btn input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.theme-toggle-track {
    width: 52px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    display: block;
    position: relative;
    cursor: pointer;
}

body.light-mode .theme-toggle-track {
    background: rgba(0, 0, 0, 0.18);
}

/* knob: 22px, track 52px, inset 3px → travel = 52-3-3-22 = 24px */
.theme-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-mode .theme-toggle-knob {
    background: #222222;
}

#loginThemeSwitch:checked + .theme-toggle-track .theme-toggle-knob {
    transform: translateX(24px);
}

.knob-moon,
.knob-sun {
    position: absolute;
    width: 12px;
    height: 12px;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* dark mode: show moon */
.knob-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    color: #222222;
}
.knob-sun {
    opacity: 0;
    transform: scale(0) rotate(-120deg);
    color: #eeeeee;
}

/* light mode: show sun */
body.light-mode .knob-moon {
    opacity: 0;
    transform: scale(0) rotate(120deg);
}
body.light-mode .knob-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ── Eye icon animation ─────────────────────────── */
.eye-icon .eye-lashes {
    opacity: 0;
    transition: opacity 0.2s ease;
}
.eye-icon .eye-iris {
    transform-origin: 12px 12px;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eye-icon .eye-pupil {
    transform-origin: 12px 12px;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
}
.eye-icon {
    transition: filter 0.22s ease;
}

.eye-icon.eye-open .eye-lashes { opacity: 1; }
.eye-icon.eye-open .eye-pupil  { transform: scale(1); opacity: 1; }
.eye-icon.eye-open {
    filter: brightness(1.8) drop-shadow(0 0 3px rgba(255,255,255,0.55));
}
body.light-mode .eye-icon.eye-open {
    filter: brightness(0.6) drop-shadow(0 0 3px rgba(0,0,0,0.3));
}

/* ── Float animation ───────────────────────────── */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 1100px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .auth-panel {
        background: #0f0f0f;
        padding: 18px;
    }

    body.light-mode .auth-panel {
        background: #f0f0f0;
    }

    .login-card {
        padding: 28px 22px 24px;
        min-height: auto;
    }

}

@media (max-width: 480px), (max-height: 700px) {
    .login-card {
        padding: 20px 16px 18px;
        min-height: unset;
        border-radius: 16px;
        overflow-y: auto;
        max-height: calc(100vh - 12px);
        justify-content: flex-start;
    }

    .auth-tabs {
        margin-bottom: 12px;
    }

    .tab-btn {
        padding: 8px 6px;
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 12px;
    }
}

/* The native GIS button is the single Google entry point once ready. */
.google-signin {
    display: flex;
    justify-content: center;
    width: min(100%, 400px);
    max-width: 100%;
    min-height: 44px;
    margin: 0 auto 16px;
    border-radius: 100px;
    overflow: hidden;
    background: transparent;
}

.google-signin iframe {
    display: block;
    max-width: 100%;
    border: 0;
    border-radius: 100px;
    background: transparent;
}
.google-signin[hidden], .google-btn[hidden], .google-error[hidden] {
    display: none;
}
.google-btn:disabled {
    cursor: wait;
    opacity: .65;
}
.google-error {
    color: var(--error-color, #e57373);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 16px;
}
