:root {
    --font-base: 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --fg-primary: #16192d;
    --fg-muted: #595d74;
    --fg-inverse: #ffffff;

    --accent: #7b72bd;
    --accent-strong: #453f75;
    --accent-subtle: rgba(105, 85, 255, 0.12);
    --accent-glow: rgba(105, 85, 255, 0.35);

    --surface: rgba(255, 255, 255, 0.88);
    --surface-alt: rgba(248, 249, 255, 0.92);
    --surface-border: rgba(255, 255, 255, 0.12);
    --surface-muted: rgba(255, 255, 255, 0.65);

    --shadow-lg: 0 28px 70px rgba(24, 32, 63, 0.28);
    --shadow-sm: 0 8px 22px rgba(24, 32, 63, 0.16);

    --danger: #d97706;

    --timing-emerge: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-card: 26px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem;
    font-family: var(--font-base);
    color: var(--fg-primary);
    line-height: 1.55;
    background-image:
        radial-gradient(circle at 12% 20%, rgba(144, 122, 255, 0.45), transparent 55%),
        radial-gradient(circle at 88% 10%, rgba(255, 176, 120, 0.4), transparent 58%),
        linear-gradient(135deg, rgba(20, 24, 48, 0.78), rgba(44, 32, 72, 0.62)),
        url("static/hero-bkg.jpg");
    background-size: cover, cover, cover, cover;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: lighten;
}

#app {
    width: 100%;
    display: grid;
    place-items: center;
}

.login-card {
    width: min(440px, 100%);
    margin: 0 auto;
    padding: clamp(2.25rem, 4vw, 3rem) clamp(1.75rem, 4vw, 2.5rem);
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, var(--surface), var(--surface-alt));
    border: 1px solid var(--surface-border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(26px);
    display: flex;
    flex-direction: column;
    gap: clamp(1.1rem, 3vw, 1.65rem);
    opacity: 0;
    transform: translateY(24px) scale(0.97);
    animation: card-enter 0.55s var(--timing-emerge) forwards;
}

.login-card > * {
    opacity: 0;
    animation: element-fade 0.45s ease forwards;
}

.login-card > *:nth-child(1) { animation-delay: 0.18s; }
.login-card > *:nth-child(2) { animation-delay: 0.26s; }
.login-card > *:nth-child(3) { animation-delay: 0.34s; }
.login-card > *:nth-child(4) { animation-delay: 0.42s; }
.login-card > *:nth-child(5) { animation-delay: 0.5s; }

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(36px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes element-fade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.login-title h2 {
    margin: 0;
    font-size: clamp(1.32rem, 2vw, 1.45rem);
    font-weight: 500;
    color: var(--fg-primary);
}

.login-title strong {
    color: var(--accent-strong);
    font-weight: 500;
}

.login-title img {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 14px;
    object-fit: contain;
}

.other-title {
    margin: 0;
    padding-top: 0.45rem;
    padding-bottom: 0.5rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--fg-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

input,
button {
    font-family: inherit;
}

input {
    width: 100%;
    height: 3.15rem;
    padding: 0 1rem;
    border-radius: 16px;
    border: 1px solid rgba(112, 119, 255, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(252, 252, 255, 0.6));
    color: var(--fg-primary);
    font-size: 0.96rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    box-shadow: inset 0 1px 1px rgba(17, 21, 36, 0.07);
}

input::placeholder {
    color: rgba(89, 93, 116, 0.7);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle), 0 12px 24px -18px var(--accent-glow);
}

input[readonly] {
    background: rgba(245, 246, 255, 0.72);
    color: var(--fg-muted);
    cursor: default;
}

.login-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 1.2rem;
    height: 2.85rem;
    border-radius: var(--radius-pill);
    border: none;
    background-image: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--fg-inverse);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 12px 26px -16px var(--accent-glow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 36px -18px var(--accent-glow);
}

.login-button:active {
    transform: translateY(1px);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: saturate(0.85);
}

.google-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: 2.8rem;
    padding: 0 1.15rem;
    width: 100%;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(112, 119, 255, 0.14);
    background: rgba(255, 255, 255, 0.78);
    color: var(--fg-primary);
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    box-shadow: 0 8px 22px -18px rgba(20, 27, 56, 0.4);
}

.google-button:hover {
    transform: translateY(-1px);
    border-color: rgba(112, 119, 255, 0.22);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 28px -20px rgba(20, 27, 56, 0.38);
}

.google-button:active {
    transform: translateY(0);
}

.google-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.breaker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0;
    width: 100%;
}

.buttons-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.input-with-button {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-bottom: 0.7rem;
}

.input-with-button input {
    padding-right: 1rem;
}

.input-with-button.has-inline-action input {
    padding-right: 5rem;
}

.input-with-button.has-inline-action .forgot-button {
    top: calc(50% - 0.35rem);
}

.input-with-button .error {
    position: absolute;
    left: 1rem;
    bottom: -0.75rem;
}

.forgot-button {
    position: absolute;
    top: 50%;
    right: 0.55rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.2rem;
    padding: 0 0.75rem;
    line-height: 1;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.forgot-button:hover {
    color: var(--accent);
    background: rgba(236, 239, 255, 0.55);
}

.error {
    font-size: 0.75rem;
    letter-spacing: 0.015em;
    color: var(--danger);
    pointer-events: none;
}

.info {
    color: var(--accent-strong) !important;
}

.error-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 26, 0.45);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.error-panel-overlay.show {
    display: flex;
}

.error-panel {
    width: min(400px, 90vw);
    padding: 2.2rem clamp(1.5rem, 4vw, 2.4rem);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(246, 246, 255, 0.9));
    box-shadow: var(--shadow-lg);
    text-align: center;
    color: var(--fg-primary);
}

.error-panel h1 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    font-weight: 500;
}

.error-panel p {
    margin: 0;
    color: var(--fg-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.error-panel button {
    margin-top: 1.65rem;
    padding: 0 1.3rem;
    height: 2.65rem;
    border-radius: var(--radius-pill);
    border: none;
    background-image: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: var(--fg-inverse);
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 14px 32px -20px var(--accent-glow);
}

.error-panel button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px -21px var(--accent-glow);
}

.verification-code {
    text-align: center;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 1.05rem;
}

span.label,
span.label2 {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--fg-muted);
    letter-spacing: 0.01em;
}

.success {
    color: var(--accent-strong) !important;
}

.text {
    font-size: 0.95rem;
    text-align: center;
    color: var(--fg-muted);
    margin: 0;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent-subtle);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    body {
        padding: clamp(2rem, 5vw, 3rem) 1rem;
    }

    .login-card {
        padding: clamp(2rem, 6vw, 2.6rem) clamp(1.4rem, 6vw, 2rem);
        gap: 1.25rem;
    }

    .login-title {
        flex-direction: column;
        text-align: center;
    }

    .breaker {
        grid-template-columns: 1fr;
    }

    .buttons-inline {
        grid-template-columns: minmax(0, 1fr);
    }

    .input-with-button.has-inline-action input {
        padding-right: 4.2rem;
    }

    .input-with-button .error {
        left: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
