/* Login / register — re-skinned onto the project's design tokens.
 *
 * Was: bedimcode/animated-login-form (MIT) with its own white-on-white system,
 * Poppins via a blocking @import and RemixIcon from a CDN. Now: the product's
 * type stack, theme tokens (works in BOTH themes), sprite glyphs. The floating
 * labels and grid structure of the original are kept — they're good. */

.login {
    position: fixed;
    inset: 0;
    display: flex;
    overflow-y: auto;
    color: var(--fg);
    z-index: 5;
    padding: 24px 0;
    /* Transparent: the background is the shared animated .hero-bg (same as the
       home page), at z-index:0 behind this overlay.
       flex + overflow-y:auto + form `margin:auto` centers the form yet lets it
       scroll when the viewport is shorter than the form. */
}

.login__form {
    position: relative;
    background: var(--card-glass);
    border: 1px solid var(--platinum-dim);
    margin: auto;
    padding: 2.5rem 1.5rem;
    border-radius: 1rem;
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    width: min(432px, calc(100vw - 3rem));
    color: var(--fg);
    box-shadow: var(--shadow-md);
}

.login__title {
    text-align: center;
    font-family: var(--display-font);
    font-size: var(--fs-h2);
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: var(--fg);
}

.login__tabs {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.login__tab {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
    box-shadow: none;
}

.login__tab.active {
    color: var(--fg);
    border-bottom-color: var(--amber);
}

.login__error {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: var(--fs-caption);
}

.login__content,
.login__box {
    display: grid;
}

.login__content {
    row-gap: 1.4rem;
    margin-bottom: 1.25rem;
}

.login__box {
    grid-template-columns: max-content 1fr;
    align-items: center;
    column-gap: 0.75rem;
    border-bottom: 1px solid var(--platinum-dim);
}

.login__icon {
    color: var(--muted);
    width: 1.25rem;
    height: 1.25rem;
}
.login__icon .glyph { width: 1.25rem; height: 1.25rem; }

.login__input {
    width: 100%;
    padding-block: 0.8rem;
    background: none;
    color: var(--fg);
    position: relative;
    z-index: 1;
    border: none;
    font-size: var(--fs-body);
}

.login__input:-webkit-autofill,
.login__input:-webkit-autofill:hover,
.login__input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--fg);
    -webkit-box-shadow: 0 0 0 1000px var(--bubble-user) inset;
    transition: background-color 5000s ease-in-out 0s;
}

.login__box-input {
    position: relative;
}

.login__label {
    position: absolute;
    left: 0;
    top: 13px;
    font-weight: 500;
    transition: top 0.3s, font-size 0.3s, color 0.3s;
    color: var(--muted);
    pointer-events: none;
}

.login__eye {
    position: absolute;
    right: 0;
    top: 14px;
    z-index: 10;
    cursor: pointer;
    color: var(--muted);
    width: 1.25rem;
    height: 1.25rem;
}
.login__eye .glyph { width: 1.25rem; height: 1.25rem; }
.login__eye:hover { color: var(--fg); }

.login__has-eye input {
    padding-right: 1.8rem;
}

.login__input:focus + .login__label,
.login__input:not(:placeholder-shown).login__input:not(:focus) + .login__label {
    top: -12px;
    font-size: var(--fs-caption);
    color: var(--amber);
}

.login__check {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1.25rem;
}

.login__forgot {
    font-size: var(--fs-caption);
    color: var(--muted);
}

.login__forgot:hover {
    color: var(--fg);
    text-decoration: underline;
}

.login__button {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.25rem;
    border: none;
    font-size: var(--fs-body);
    transition: transform .15s, box-shadow .15s;
}

.login__button:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.login__divider {
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-caption);
    margin: 0.75rem 0 1rem;
    position: relative;
}

.login__divider::before,
.login__divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--platinum-line);
}

.login__divider::before { left: 0; }
.login__divider::after { right: 0; }

.login__oauth {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
}

.login__oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--fg);
    background: var(--bubble-user);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.login__oauth-btn:hover {
    border-color: var(--platinum-dim);
    background: var(--bubble-agent);
}

.login__register {
    text-align: center;
    font-size: var(--fs-caption);
    color: var(--muted);
}

.login__register a {
    color: var(--fg);
    font-weight: 500;
}

.login__register a:hover {
    text-decoration: underline;
}

/* Hide top nav on login page for a clean full-screen look.
   .hero-bg stays visible — it's the page background now. */
.login-page .topbar {
    display: none !important;
}

.login-page main.container {
    max-width: none;
    padding: 0;
    margin: 0;
    /* The global .container glass uses backdrop-filter, which makes it the
       containing block for position:fixed descendants. That trapped .login
       (fixed; inset:0) inside a zero-height box → form clipped → blank page.
       Strip the glass here so .login resolves against the viewport. */
    background: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@media (min-width: 576px) {
    .login__form {
        padding: 3rem 2.5rem 2.5rem;
        border-radius: 1.25rem;
    }
}
