:root {
    --clay-900: #522c1f;
    --clay-700: #7d4937;
    --clay-500: #a8664d;
    --clay-100: #ead8cf;
    --cream: #f7f2ed;
    --white: #ffffff;
    --ink: #28201c;
    --muted: #70645e;
    --error: #a2332a;
    --shadow: 0 24px 70px rgba(77, 43, 31, 0.13);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 10%, rgba(168, 102, 77, 0.12), transparent 28rem),
        linear-gradient(145deg, var(--white), var(--cream));
    font-family: "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem 1.25rem;
}

.login-card {
    position: relative;
    width: min(100%, 460px);
    overflow: hidden;
    padding: 2.5rem 3rem 2rem;
    border: 1px solid rgba(125, 73, 55, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, var(--clay-900), var(--clay-500));
    content: "";
}

.brand {
    text-align: center;
}

.brand-mark {
    position: relative;
    width: 74px;
    height: 70px;
    margin: 0 auto 0.9rem;
}

.racket {
    position: absolute;
    top: 1px;
    left: 14px;
    width: 34px;
    height: 45px;
    border: 3px solid var(--clay-900);
    border-radius: 50%;
    transform: rotate(-35deg);
}

.racket::before,
.racket::after {
    position: absolute;
    content: "";
}

.racket::before {
    top: 40px;
    left: 14px;
    width: 4px;
    height: 25px;
    border-radius: 3px;
    background: var(--clay-900);
}

.racket::after {
    inset: 5px;
    border-radius: 50%;
    background:
        repeating-linear-gradient(90deg, transparent 0 5px, rgba(82, 44, 31, 0.25) 5px 6px),
        repeating-linear-gradient(0deg, transparent 0 5px, rgba(82, 44, 31, 0.25) 5px 6px);
}

.tennis-ball {
    position: absolute;
    top: 7px;
    right: 5px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--clay-500);
    box-shadow: inset -4px -4px 0 rgba(82, 44, 31, 0.16);
}

.tennis-ball::after {
    position: absolute;
    inset: 5px -2px;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-right-color: transparent;
    border-left-color: transparent;
    border-radius: 50%;
    content: "";
    transform: rotate(45deg);
}

.brand-kicker {
    margin: 0 0 0.4rem;
    color: var(--clay-700);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand h1 {
    margin: 0;
    color: var(--clay-900);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 7vw, 2rem);
    font-weight: 600;
    line-height: 1.08;
}

.welcome-copy {
    margin: 2rem 0 1.4rem;
    text-align: center;
}

.welcome-copy h2 {
    margin: 0 0 0.45rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 600;
}

.welcome-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.field {
    margin-bottom: 1.15rem;
}

.field label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--clay-900);
    font-size: 0.84rem;
    font-weight: 650;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 0.8rem 0.9rem;
    border: 1px solid #d8cbc4;
    border-radius: 11px;
    outline: none;
    color: var(--ink);
    background: var(--white);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
    color: #9b918c;
}

.field input:focus {
    border-color: var(--clay-500);
    box-shadow: 0 0 0 4px rgba(168, 102, 77, 0.13);
}

.field input[aria-invalid="true"] {
    border-color: var(--error);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 5.2rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    padding: 0.3rem;
    border: 0;
    color: var(--clay-700);
    background: transparent;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    transform: translateY(-50%);
}

.field-error {
    display: none;
    margin: 0.38rem 0 0;
    color: var(--error);
    font-size: 0.77rem;
}

.field-error.is-visible {
    display: block;
}

.form-help {
    margin: -0.2rem 0 1.35rem;
    text-align: right;
}

.form-help a {
    color: var(--clay-700);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

.form-help a:hover,
.form-help a:focus-visible {
    text-decoration: underline;
}

.submit-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 11px;
    color: var(--white);
    background: linear-gradient(110deg, var(--clay-900), var(--clay-700));
    box-shadow: 0 10px 24px rgba(82, 44, 31, 0.2);
    cursor: pointer;
    font-weight: 750;
    letter-spacing: 0.03em;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.submit-button:hover {
    box-shadow: 0 13px 30px rgba(82, 44, 31, 0.27);
    transform: translateY(-1px);
}

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

.prototype-message {
    min-height: 1.2rem;
    margin: 0.75rem 0 0;
    color: var(--clay-700);
    font-size: 0.79rem;
    text-align: center;
}

.login-card footer {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--clay-100);
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.82rem;
    font-style: italic;
    text-align: center;
}

.login-card footer p {
    margin: 0;
}

@media (max-width: 520px) {
    .login-page {
        align-items: stretch;
        padding: 0;
    }

    .login-card {
        display: flex;
        min-height: 100vh;
        flex-direction: column;
        justify-content: center;
        padding: 2rem 1.4rem;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

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

.login-error,
.server-message {
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.login-error {
    border: 1px solid rgba(162, 51, 42, 0.25);
    color: var(--error);
    background: rgba(162, 51, 42, 0.07);
}

.server-message {
    border: 1px solid var(--clay-100);
    color: var(--clay-900);
    background: var(--cream);
}

.submit-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.auth-options form {
    margin: 0;
}

.google-button {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid #d8cbc4;
    border-radius: 11px;
    color: var(--ink);
    background: var(--white);
    cursor: pointer;
    font-weight: 700;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.google-button:hover,
.google-button:focus-visible {
    border-color: var(--clay-500);
    box-shadow: 0 8px 22px rgba(82, 44, 31, 0.12);
    transform: translateY(-1px);
}

.google-mark {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #4285f4;
    background: #f5f8ff;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 800;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.15rem 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
    flex: 1;
    height: 1px;
    background: var(--clay-100);
    content: "";
}

.security-copy,
.auth-notice {
    margin: 1.1rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
}

.auth-notice {
    margin-top: 0;
    padding: 0.75rem;
    border-radius: 10px;
    background: var(--cream);
}

.code-field input {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 750;
    letter-spacing: 0.28em;
}

.resend-form {
    margin-top: 1rem;
    text-align: center;
}

.text-button,
.auth-back {
    border: 0;
    color: var(--clay-700);
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-back {
    display: block;
    margin-top: 1rem;
    text-align: center;
}

.text-button:hover,
.text-button:focus-visible,
.auth-back:hover,
.auth-back:focus-visible {
    text-decoration: underline;
}

.link-button {
    display: grid;
    place-items: center;
    text-decoration: none;
}
