:root {
    --brand: #7445FF;
    --brand-deep: #4A1FD4;
    --accent: #FDDD35;
    --accent-hot: #FFE566;
    --ink: #160A32;
    --white: #FFFFFF;
    --line: rgba(255, 255, 255, 0.28);
    --font: 'Ubuntu Sans Mono', ui-monospace, monospace;
}

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

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    font-family: var(--font);
    color: var(--white);
    background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
}

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

.auth-brand {
    display: inline-block;
    font-size: clamp(28px, 8vw, 40px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--white);
    text-decoration: none;
    margin-bottom: 10px;
}

.auth-brand .dot {
    display: inline-block;
    width: 0.16em;
    height: 0.16em;
    margin-left: 0.02em;
    vertical-align: 0.12em;
    border-radius: 50%;
    background: var(--accent);
}

.auth-lead {
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 22px;
}

.auth-card {
    border: 1px solid var(--line);
    background: rgba(22, 10, 50, 0.42);
    padding: 22px 20px 20px;
}

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

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.auth-field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.auth-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    font: 500 0.92rem/1.3 var(--font);
}

.auth-field input::placeholder { color: rgba(255, 255, 255, 0.35); }

.auth-field input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}

.auth-password {
    position: relative;
    display: block;
}

.auth-password input { padding-right: 44px; }

.auth-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.65;
}

.auth-eye::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    margin: 0 auto;
    background: center / 20px 20px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12s3.6-6.5 9.5-6.5S21.5 12 21.5 12 17.9 18.5 12 18.5 2.5 12 2.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3C/svg%3E");
}

.auth-eye.is-on::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12s3.6-6.5 9.5-6.5S21.5 12 21.5 12 17.9 18.5 12 18.5 2.5 12 2.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.4'/%3E%3Cpath d='M4 4l16 16'/%3E%3C/svg%3E");
}

.auth-eye:hover { opacity: 1; }

.auth-submit {
    width: 100%;
    margin-top: 6px;
    padding: 14px 18px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--ink);
    font: 700 0.72rem/1 var(--font);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.auth-submit:hover {
    background: var(--accent-hot);
    transform: translateY(-1px);
}

.auth-submit:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.auth-switch {
    margin-top: 16px;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth-switch button {
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-messages {
    margin-bottom: 14px;
}

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

.auth-messages p {
    padding: 10px 12px;
    border: 1px solid var(--line);
    font-size: 0.82rem;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.28);
}

.auth-messages .error {
    border-color: rgba(255, 120, 140, 0.55);
    color: #ffb3bf;
}

.auth-messages .success {
    border-color: rgba(125, 255, 154, 0.55);
    color: #b8ffc8;
}

.auth-messages .info {
    color: rgba(255, 255, 255, 0.85);
}

/* —— Модалка на лендинге —— */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px 14px;
    font-family: var(--font);
    color: var(--white);
    background: rgba(22, 10, 50, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.auth-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal__panel {
    position: relative;
    width: min(100%, 440px);
    max-height: min(92vh, 820px);
    overflow: auto;
    padding: 28px 22px 22px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
    box-shadow: 12px 16px 0 rgba(0, 0, 0, 0.18);
    transform: translateY(10px);
    transition: transform 0.22s ease;
}

.auth-modal.is-open .auth-modal__panel {
    transform: none;
}

.auth-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--white);
    font: 700 1.2rem/1 var(--font);
    cursor: pointer;
}

.auth-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.auth-modal .auth-brand {
    pointer-events: none;
}

body.auth-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .auth-modal__panel {
        padding: 24px 16px 18px;
        box-shadow: none;
    }
}
