:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --ink: #171b22;
    --muted: #6f7785;
    --line: #dde2eb;
    --soft: #f2f5f8;
    --orange: #ff642d;
    --orange-dark: #d9480f;
    --teal: #0e9f8f;
    --red: #dc2626;
    --red-soft: #fee2e2;
    --amber-soft: #fff4d8;
    --radius: 8px;
    --shadow: 0 18px 48px rgba(25, 31, 43, 0.08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(14, 159, 143, 0.12), rgba(245, 158, 11, 0.1)),
        var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body.login-loading-active {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(520px, 100%);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.brand,
.login-loading-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--orange);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

.brand strong,
.brand small,
.login-loading-brand strong,
.login-loading-brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    line-height: 1.1;
}

.brand small,
.login-loading-brand small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.auth-brand {
    margin-bottom: 24px;
}

.eyebrow {
    color: var(--orange-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-copy {
    margin-bottom: 18px;
}

.auth-copy h1 {
    margin: 6px 0;
    font-size: 32px;
    line-height: 1.05;
}

.auth-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.google-identity-login {
    display: grid;
    gap: 8px;
    width: 100%;
}

.google-button-slot {
    min-height: 44px;
    overflow: hidden;
}

.google-button-slot > div,
.google-button-slot iframe {
    width: 100% !important;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 17px 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: var(--line);
    content: "";
}

.auth-divider span {
    white-space: nowrap;
}

.google-login-status {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid #fecaca;
    border-radius: 7px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.4;
}

.auth-form label {
    display: grid;
    gap: 7px;
}

.auth-form label > span:first-child {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: 0;
    background: #ffffff;
    color: var(--ink);
}

.auth-form input:focus {
    border-color: rgba(255, 100, 45, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 100, 45, 0.12);
}

.auth-password-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    padding-right: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
}

.auth-password-field:focus-within {
    border-color: rgba(255, 100, 45, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 100, 45, 0.12);
}

.auth-password-field input {
    min-height: 40px;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.auth-password-field input:focus {
    box-shadow: none;
}

.auth-password-field button {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: var(--soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-password-field button:hover {
    background: #e9eef5;
    color: var(--ink);
}

.auth-password-field button i,
.login-loading-steps i {
    display: none;
}

.primary-button {
    display: inline-flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    padding: 0 15px;
    border: 1px solid var(--orange);
    border-radius: var(--radius);
    background: var(--orange);
    color: #ffffff;
    font-weight: 750;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(25, 31, 43, 0.12);
}

.auth-alt {
    margin: 14px 0 0;
    font-size: 13px;
    text-align: center;
}

.auth-alt a {
    color: var(--orange-dark);
    font-weight: 700;
}

.auth-alt a:hover {
    text-decoration: underline;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
}

.flash.positive {
    background: #dcfbf5;
    color: #087768;
}

.flash.negative {
    background: var(--red-soft);
    color: var(--red);
}

.flash.warning {
    background: var(--amber-soft);
    color: #9a6500;
}

.login-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(rgba(226, 232, 240, 0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.55) 1px, transparent 1px),
        linear-gradient(145deg, #f8fafc 0%, #eef4f9 100%);
    background-size: 42px 42px, 42px 42px, auto;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.login-loading-screen.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.login-loading-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 100, 45, 0.08), transparent 36%),
        linear-gradient(315deg, rgba(14, 159, 143, 0.1), transparent 40%);
}

.login-loading-card {
    position: relative;
    display: grid;
    width: min(560px, 100%);
    justify-items: center;
    gap: 16px;
    padding: 32px;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
    text-align: center;
}

.login-loading-brand {
    justify-self: start;
    text-align: left;
}

.login-loading-orbit {
    position: relative;
    display: grid;
    width: 112px;
    height: 112px;
    place-items: center;
    border-radius: 999px;
    background: conic-gradient(from 0deg, rgba(255, 100, 45, 0.12), var(--orange), rgba(14, 159, 143, 0.9), rgba(255, 100, 45, 0.12));
    animation: login-loading-spin 1.1s linear infinite;
}

.login-loading-orbit::before {
    position: absolute;
    inset: 8px;
    border-radius: inherit;
    background: #ffffff;
    content: "";
}

.login-loading-orbit::after {
    position: absolute;
    inset: 26px;
    border: 1px dashed rgba(100, 116, 139, 0.42);
    border-radius: inherit;
    content: "";
}

.login-loading-orbit span {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(14, 159, 143, 0.28);
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(14, 159, 143, 0.16), rgba(255, 100, 45, 0.12)), #f8fafc;
}

.login-loading-orbit i {
    position: absolute;
    z-index: 2;
    top: 10px;
    width: 12px;
    height: 12px;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: 0 8px 20px rgba(14, 159, 143, 0.28);
}

.login-loading-card h2 {
    margin: 0;
    font-size: clamp(24px, 5vw, 34px);
    line-height: 1.05;
}

.login-loading-card p {
    max-width: 390px;
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.login-loading-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.login-loading-steps span {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 0 10px;
    border: 1px solid #dfe6ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

@keyframes login-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-loading-screen,
    .login-loading-orbit {
        animation: none;
        transition: none;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 16px;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .login-loading-screen {
        padding: 16px;
    }

    .login-loading-card {
        gap: 14px;
        padding: 24px 18px;
    }

    .login-loading-brand {
        justify-self: center;
    }

    .login-loading-orbit {
        width: 96px;
        height: 96px;
    }
}

/* Rankings by Lithium identity */
.product-brand-logo {
    display: block;
    width: 100%;
    height: auto;
}

.auth-brand {
    display: block;
    width: min(270px, 78vw);
}

.login-loading-brand {
    display: block;
    width: min(300px, 74vw);
    justify-self: center;
}
