/* Sonder auth — iOS/Android parity (systemBlue), refined light surface */

body.auth-page {
    --auth-blue: #007aff;
    --auth-blue-hover: #0066d6;
    --auth-blue-pressed: #0055b3;
    --auth-blue-soft: rgba(0, 122, 255, 0.16);
    --auth-bg-top: #e8eef8;
    --auth-bg-mid: #f3f5f9;
    --auth-bg-bottom: #fafbfc;
    --auth-card: rgba(255, 255, 255, 0.92);
    --auth-text: #111111;
    --auth-muted: #6e6e73;
    --auth-border: rgba(0, 0, 0, 0.08);
    --auth-field: #f2f2f7;
    --auth-field-border: transparent;
    --accent: var(--auth-blue);
    --accent-hover: var(--auth-blue-hover);

    padding-top: 0;
    min-height: 100vh;
    color: var(--auth-text);
    background:
        radial-gradient(900px 480px at 50% -10%, rgba(0, 122, 255, 0.14), transparent 60%),
        radial-gradient(640px 360px at 85% 20%, rgba(0, 122, 255, 0.06), transparent 55%),
        linear-gradient(180deg, var(--auth-bg-top) 0%, var(--auth-bg-mid) 42%, var(--auth-bg-bottom) 100%) !important;
}

body.auth-page a:focus-visible,
body.auth-page button:focus-visible {
    outline-color: var(--auth-blue);
}

body.auth-page .navbar {
    height: 64px;
    padding: 12px 0;
    background: rgba(243, 245, 249, 0.72);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
}

body.auth-page .logo {
    color: var(--auth-text);
    font-size: 1.25rem;
}

body.auth-page .logo:hover {
    color: var(--auth-text);
}

body.auth-page .logo span {
    color: var(--auth-blue);
}

body.auth-page section.auth-panel {
    padding: 0;
}

.auth-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 64px);
    padding: 88px 20px 48px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--auth-card);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    padding: 36px 32px 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.8) inset,
        0 18px 48px rgba(15, 23, 42, 0.08),
        0 2px 8px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.auth-mark {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: block;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.auth-app-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: var(--auth-text);
}

.auth-panel[hidden] {
    display: none !important;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 4px 0 8px;
    letter-spacing: -0.03em;
    color: var(--auth-text);
}

.auth-lead {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--auth-text);
}

.auth-hint {
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 26px;
    text-align: center;
}

.auth-panel[data-panel="register"] .auth-hint,
.auth-panel[data-panel="otp"] .auth-hint,
.auth-panel[data-panel="success"] .auth-hint {
    text-align: left;
}

.auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 550;
    color: var(--auth-muted);
    margin: 16px 0 8px;
    letter-spacing: 0.01em;
}

.auth-phone {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--auth-field-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--auth-field);
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.auth-phone:focus-within {
    background: #fff;
    box-shadow: 0 0 0 3px var(--auth-blue-soft);
}

.auth-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--auth-text);
    font-family: var(--font, inherit);
    font-size: 1.05rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.03);
    user-select: none;
}

.auth-input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid var(--auth-field-border);
    background: var(--auth-field);
    color: var(--auth-text);
    font-size: 1.05rem;
    font-family: var(--font, inherit);
    outline: none;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
    color: #aeaeb2;
}

.auth-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px var(--auth-blue-soft);
}

.auth-input-phone {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
    padding-left: 14px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.auth-input-phone:focus {
    border: none;
    background: transparent;
    box-shadow: none !important;
}

.auth-input-otp {
    letter-spacing: 0.42em;
    font-size: 1.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    padding-left: 1.1em;
}

.auth-field-hint {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--auth-muted);
    line-height: 1.35;
}

.auth-error {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.18);
    color: #d70015;
    font-size: 0.9rem;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 24px;
    min-height: 50px;
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    background: var(--auth-blue);
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 650;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 122, 255, 0.28);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.auth-btn:hover:not(:disabled) {
    background: var(--auth-blue-hover);
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(0, 122, 255, 0.34);
}

.auth-btn:active:not(:disabled) {
    background: var(--auth-blue-pressed);
    transform: translateY(1px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.22);
}

.auth-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-btn-ghost {
    margin-top: 10px;
    background: transparent;
    border: none;
    color: var(--auth-blue) !important;
    font-weight: 600;
    box-shadow: none;
    min-height: 44px;
}

.auth-btn-ghost:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.08);
    color: var(--auth-blue-hover) !important;
    box-shadow: none;
}

.auth-btn-secondary {
    width: auto;
    min-width: 0;
    min-height: 40px;
    margin: 8px auto 4px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    background: transparent;
    color: var(--auth-blue) !important;
    border: 1px solid rgba(0, 122, 255, 0.35);
    box-shadow: none;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.08);
    color: var(--auth-blue-hover) !important;
    border-color: rgba(0, 122, 255, 0.5);
    box-shadow: none;
}

.auth-btn-secondary:active:not(:disabled) {
    background: rgba(0, 122, 255, 0.12);
    transform: none;
    box-shadow: none;
}

.auth-btn.is-loading {
    position: relative;
    color: transparent !important;
}

.auth-btn.is-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-switch {
    margin-top: 24px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.95rem;
}

.auth-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--auth-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.auth-link:hover {
    color: var(--auth-blue-hover);
}

.auth-back {
    background: none;
    border: none;
    color: var(--auth-blue);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.auth-back:hover {
    color: var(--auth-blue-hover);
}

.auth-user {
    margin: 8px 0 20px;
    font-weight: 650;
    color: var(--auth-text);
    font-size: 1.05rem;
}

.auth-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 8px 0 18px;
}

.auth-panel[data-panel="success"] {
    text-align: center;
}

.auth-panel[data-panel="success"] .auth-title {
    margin-top: 0;
}

.auth-panel[data-panel="success"] .auth-hint {
    text-align: center;
    margin-bottom: 12px;
}

.auth-panel[data-panel="success"] .auth-user {
    margin: 0 0 16px;
}

.auth-panel[data-panel="success"] .auth-btn-secondary {
    display: inline-flex;
}

.auth-panel[data-panel="success"] .auth-stores {
    margin-top: 18px;
}

.auth-panel[data-panel="success"] .auth-link {
    display: inline-block;
    margin-top: 4px;
}

@media (max-width: 480px) {
    body.auth-page .navbar {
        background: transparent;
        border-bottom: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .auth-main {
        align-items: flex-start;
        padding: 76px 16px 32px;
        min-height: auto;
    }

    .auth-card {
        max-width: none;
        padding: 28px 20px 24px;
        border-radius: 24px;
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.75) inset,
            0 12px 36px rgba(15, 23, 42, 0.07);
    }

    .auth-mark {
        width: 64px;
        height: 64px;
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn,
    .auth-phone,
    .auth-input {
        transition: none;
    }

    .auth-btn:active:not(:disabled) {
        transform: none;
    }

    .auth-btn.is-loading::after {
        animation: none;
    }
}
