:root {
    --auth-bg-start: #070c16;
    --auth-bg-end: #0a1220;
    --auth-surface: rgba(255, 255, 255, 0.06);
    --auth-surface-strong: rgba(255, 255, 255, 0.08);
    --auth-text: #f7fbff;
    --auth-muted: rgba(255, 255, 255, 0.62);
    --auth-deep: #ffffff;
    --auth-ink: #0d2430;
    --auth-white: #ffffff;
    --auth-outline: rgba(255, 255, 255, 0.12);
    --auth-link: rgba(234, 244, 255, 0.92);
    --auth-card-bg: rgba(255, 255, 255, 0.06);
    --auth-card-border: rgba(255, 255, 255, 0.1);
    --auth-input-bg: rgba(10, 17, 30, 0.78);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-primary-start: #1f426e;
    --auth-primary-end: #173455;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(circle at top, rgba(38, 68, 110, 0.28), transparent 42%),
        linear-gradient(140deg, transparent 0 39%, rgba(255, 255, 255, 0.03) 39% 61%, transparent 61% 100%),
        linear-gradient(180deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 100%);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 18px;
}

.auth-shell {
    width: min(100%, 420px);
}

.auth-brand-mark {
    width: 156px;
    height: 156px;
    margin: 0 auto 20px;
    border-radius: 18px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.auth-brand-mark img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.auth-panel {
    text-align: center;
}

.auth-panel-topline {
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.auth-panel h1 {
    margin: 0;
    color: var(--auth-white);
    font-size: clamp(26px, 6.6vw, 40px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-subtitle {
    margin: 14px auto 18px;
    max-width: 320px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-status {
    width: min(100%, 350px);
    margin: 0 auto 18px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
}

.auth-status[hidden] {
    display: none;
}

.auth-status.is-error {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.34);
    color: #ffd6d6;
}

.auth-status.is-success {
    background: rgba(84, 203, 134, 0.1);
    border-color: rgba(84, 203, 134, 0.28);
    color: #d4ffe4;
}

.auth-mode-links {
    width: min(100%, 350px);
    margin: 0 auto 26px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-mode-link,
.auth-inline-link {
    border: none;
    background: transparent;
    color: var(--auth-link);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.auth-mode-link {
    padding: 0;
    opacity: 0.68;
    text-transform: uppercase;
}

.auth-mode-link.active {
    color: var(--auth-white);
    opacity: 1;
    text-shadow: 0 0 18px rgba(106, 162, 229, 0.24);
}

.auth-form {
    display: none;
    width: min(100%, 350px);
    margin: 0 auto;
}

.auth-form.is-active {
    display: block;
}

.auth-input-pill {
    position: relative;
    display: block;
    margin-bottom: 20px;
}

.auth-input-pill input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--auth-input-border);
    border-radius: 999px;
    background: var(--auth-input-bg);
    color: var(--auth-deep);
    font-size: 14px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-input-pill-left input {
    padding: 0 22px 0 82px;
}

.auth-input-pill-right input {
    padding: 0 82px 0 22px;
}

.auth-input-pill input::placeholder {
    color: rgba(255, 255, 255, 0.34);
}

.auth-input-pill input:focus {
    border-color: rgba(105, 163, 230, 0.34);
    box-shadow: 0 0 0 4px rgba(105, 163, 230, 0.1);
}

.auth-input-icon {
    position: absolute;
    top: 50%;
    width: 56px;
    height: 56px;
    margin-top: -28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.auth-input-pill-left .auth-input-icon {
    left: 0;
}

.auth-input-pill-right .auth-input-icon {
    right: 0;
}

.auth-submit-btn {
    width: 100%;
    height: 62px;
    margin-top: 8px;
    border: 1px solid rgba(105, 163, 230, 0.34);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--auth-primary-start) 0%, var(--auth-primary-end) 100%);
    color: #eaf4ff;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 18px 36px rgba(8, 16, 29, 0.34);
}

.auth-submit-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.auth-inline-links {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.auth-telegram-wrap {
    width: min(100%, 350px);
    margin: 26px auto 0;
}

.auth-panel.is-telegram-only #authFormsWrap {
    display: none;
}

.auth-telegram-btn {
    width: 100%;
    height: 52px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: var(--auth-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.auth-telegram-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.auth-hint {
    margin-top: 10px;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-web-hint {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 420px) {
    .auth-panel h1 {
        font-size: 26px;
    }

    .auth-input-pill input {
        height: 54px;
    }

    .auth-input-icon {
        width: 54px;
        height: 54px;
        margin-top: -27px;
        font-size: 20px;
    }
}
