﻿/* UI redesign start */
:root {
    --bg: #f7f7f8;
    --card: transparent;
    --text: #111111;
    --muted: #8f8f95;
    --border: #e8e8ea;
    --primary: var(--color-accent, #c15f3c);
    --primary-hover: var(--color-accent-hover, #a94d2e);
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --radius-xl: 999px;
    --radius-lg: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    font-family: "Inter", sans-serif;
    background: radial-gradient(ellipse at 50% 0%, rgba(193, 95, 60, 0.06) 0%, transparent 60%), var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button,
a {
    font: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.auth-bg {
    display: none;
}

.page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 18px 26px;
    position: relative;
    overflow: hidden;
}

.topbar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.contact-link {
    text-decoration: none;
    color: #7e7e84;
    font-size: 15px;
    font-weight: 700;
    transition: 0.2s ease;
}

.contact-link:hover {
    color: #5f5f66;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 120px;
    user-select: none;
}

.logo-mark {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    background: linear-gradient(145deg, rgba(193, 95, 60, 0.12), rgba(193, 95, 60, 0.06));
    border: 1px solid rgba(193, 95, 60, 0.14);
    color: var(--primary);
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.6px;
}

.brand-name {
    font-size: 44px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -1.7px;
    color: var(--primary);
}

.actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-btn,
.oauth-button {
    width: 100%;
    padding: 0 13px;
    min-height: 55px;
    border-radius: var(--radius-xl);
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 14.5px;
    font-weight: 800;
    color: #111111;
    text-decoration: none;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        opacity 0.18s ease;
}

.auth-btn:hover,
.oauth-button:hover {
    transform: translateY(-1px);
    border-color: #dcdce0;
    background: rgba(255, 255, 255, 0.62);
}



.oauth-button:focus-visible,
.auth-footer__button:focus-visible,
.checkbox-wrap input:focus-visible + .custom-check {
    outline: 2px solid rgba(193, 95, 60, 0.3);
    outline-offset: 2px;
}

.oauth-button.is-loading {
    opacity: 0.50;
    border-color: rgba(193, 95, 60, 0.2);
}

.oauth-button.is-disabled {
    opacity: 0.56;
}

.oauth-button:disabled {
    cursor: default;
}

.auth-icon,
.oauth-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-icon svg,
.oauth-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.oauth-button__label {
    line-height: 1.2;
}

.terms {
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 2px 4px;
}

.checkbox-wrap {
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-wrap input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.custom-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #111111;
    border: 1px solid #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.custom-check:hover {
    transform: scale(1.04);
}

.custom-check svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.checkbox-wrap input:not(:checked) + .custom-check {
    background: transparent;
    border-color: #d4d4d8;
}

.checkbox-wrap input:not(:checked) + .custom-check svg {
    opacity: 0;
    transform: scale(0.72);
}

.terms-text {
    color: #909097;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 700;
}

.terms-text a {
    color: #1c1c1f;
    text-decoration: none;
    font-weight: 800;
}

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

.auth-status {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.72);
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
}

.auth-status[data-state="loading"] {
    color: #5b6473;
}

.auth-status[data-state="success"] {
    color: #256245;
    border-color: rgba(37, 98, 69, 0.14);
    background: rgba(246, 251, 245, 0.92);
}

.auth-status[data-state="error"] {
    color: #8f3131;
    border-color: rgba(143, 49, 49, 0.12);
    background: rgba(255, 244, 244, 0.92);
}

.auth-footer {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.auth-footer__button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1c1c1f;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.auth-footer__button:hover {
    text-decoration: underline;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 768px) {
    .page {
        padding: 28px 28px 34px;
    }

    .content {
        max-width: 460px;
    }

    .brand {
        margin-bottom: 110px;
    }

    .brand-name {
        font-size: 52px;
    }

    .auth-btn,
    .oauth-button {
        min-height: 60px;
        font-size: 20px;
        padding: 0;
    }

    .terms-text {
        font-size: 16px;
    }

    .contact-link {
        font-size: 16px;
    }
}

@media (max-height: 760px) {
    .brand {
        margin-bottom: 70px;
    }

    .brand-name {
        font-size: 38px;
    }

    .logo-mark {
        width: 68px;
        height: 68px;
        font-size: 30px;
    }
}
/* UI redesign end */

/* ── Dark mode ────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg: #0d0f14;
    --card: rgba(255, 255, 255, 0.04);
    --text: #e8eaed;
    --muted: #6b7280;
    --border: rgba(255, 255, 255, 0.1);
    --primary: #d4724a;
    --primary-hover: #c15f3c;
    --white: #1c1f27;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] html,
[data-theme="dark"] body {
    background: radial-gradient(ellipse at 50% 0%, rgba(193, 95, 60, 0.06) 0%, transparent 60%), var(--bg);
    color: var(--text);
}

[data-theme="dark"] .contact-link {
    color: #6b7280;
}

[data-theme="dark"] .contact-link:hover {
    color: #9ba4b0;
}

[data-theme="dark"] .auth-btn,
[data-theme="dark"] .oauth-button {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eaed;
}

[data-theme="dark"] .auth-btn:hover,
[data-theme="dark"] .oauth-button:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .custom-check {
    background: #e8eaed;
    border-color: #e8eaed;
}

[data-theme="dark"] .checkbox-wrap input:not(:checked) + .custom-check {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .terms-text {
    color: #6b7280;
}

[data-theme="dark"] .terms-text a {
    color: #e8eaed;
}

[data-theme="dark"] .auth-status {
    background: rgba(22, 25, 32, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: #9ba4b0;
}

[data-theme="dark"] .auth-status[data-state="success"] {
    color: #5aad85;
    border-color: rgba(90, 173, 133, 0.2);
    background: rgba(90, 173, 133, 0.08);
}

[data-theme="dark"] .auth-status[data-state="error"] {
    color: #e05c5c;
    border-color: rgba(224, 92, 92, 0.2);
    background: rgba(224, 92, 92, 0.08);
}

[data-theme="dark"] .auth-footer__button {
    color: #e8eaed;
}
