@import url('theme.css?v=2');

.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg-1);
}

.scene::before,
.scene::after {
    content: "";
    position: absolute;
    width: 46vmax;
    height: 46vmax;
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
    pointer-events: none;
}
.scene::before {
    background: var(--blob-a);
    top: -18vmax;
    inset-inline-start: -14vmax;
}
.scene::after {
    background: var(--blob-b);
    bottom: -20vmax;
    inset-inline-end: -12vmax;
}

.login-card {
    /* A touch more glass than the shared default, just for this page. */
    --card-bg: rgba(255, 255, 255, 0.46);
    --radius: 26px;

    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    padding: 42px 32px 32px;
    animation: rise .55s cubic-bezier(.2, .8, .2, 1);
    transition: background-color .4s ease, border-color .4s ease;
}

:root[data-theme="dark"] .login-card {
    --card-bg: rgba(22, 30, 29, 0.42);
}

@keyframes rise {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.brand { text-align: center; margin-bottom: 26px; }

.brand-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-solid), var(--primary-solid-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    box-shadow: 0 10px 24px -8px var(--primary-soft);
}

.brand-logo-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 24px -8px var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    overflow: hidden;
    transition: background-color .3s ease, padding .3s ease;
}

/* Dark mode: a near-white chip so the logo fills its frame and stays
   crisp, instead of floating small inside a barely-visible glass box. */
:root[data-theme="dark"] .brand-logo-wrap {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 255, 255, 0.18);
    padding: 4px;
}

.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.brand h1 {
    font-size: 21px;
    margin: 0;
    font-weight: 800;
    letter-spacing: .2px;
}
.brand-sub {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.alert {
    font-size: 13.5px;
    font-weight: 500;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    line-height: 1.7;
}
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info  { background: var(--info-bg); color: var(--info-text); }

.field-group {
    margin-bottom: 18px;
    overflow: hidden;
    max-height: 140px;
    opacity: 1;
    transition: max-height .35s ease, opacity .3s ease, margin .35s ease;
}
.field-group.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    pointer-events: none;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    font-size: 14.5px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s, transform .1s;
}

input::placeholder { color: var(--text-muted); opacity: .7; }

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--ring);
    background: var(--input-bg-focus);
    transform: translateY(-1px);
}

input.input-error { border-color: var(--error); }

.password-wrap { position: relative; }
.password-wrap input { padding-inline-start: 42px; }

.toggle-eye {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.toggle-eye:hover { color: var(--primary); }

.field-error {
    display: block;
    font-size: 12.5px;
    color: var(--error);
    margin-top: 6px;
    min-height: 1px;
    font-weight: 500;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-solid), var(--primary-solid-dark));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: filter .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 12px 26px -10px var(--primary-soft);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; }

.spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-passkey {
    width: 100%;
    padding: 13px;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: border-color .2s, background-color .2s, transform .1s, box-shadow .2s;
}
.btn-passkey:focus-visible { box-shadow: 0 0 0 4px var(--ring); }
.btn-passkey:hover { border-color: var(--primary); color: var(--primary-dark); }
:root[data-theme="dark"] .btn-passkey:hover { color: var(--primary); }
.btn-passkey:active { transform: scale(.99); }
.btn-passkey:disabled { opacity: .55; cursor: not-allowed; }

.footer-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 22px 0 0;
    font-weight: 500;
}

/* Login page pins the shared .theme-toggle (styled in theme.css) top-corner */
.theme-toggle {
    position: fixed;
    top: 20px;
    inset-inline-end: 20px;
    z-index: 10;
}

@media (max-width: 420px) {
    .login-card { padding: 34px 22px 26px; }
    .theme-toggle { top: 14px; inset-inline-end: 14px; }
}
