/* Макет входа/регистрации (цвета из :root в base.html) — дублирует auth_domos_embedded.html */

.auth-page {
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 24px 56px;
    box-sizing: border-box;
}

.auth-page--immersive {
    position: relative;
    isolation: isolate;
    padding: 48px 28px 88px;
    min-height: calc(100vh - 40px);
}

.auth-page--immersive::after {
    content: "";
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: -35%;
    height: 55%;
    background: radial-gradient(ellipse 65% 50% at 65% 100%, rgba(90, 110, 180, 0.12), transparent 62%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

.auth-page--immersive .auth-tabs,
.auth-page--immersive .auth-card,
.auth-page--immersive > .auth-messages {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
}

.auth-page--immersive .auth-card {
    max-width: 640px;
    padding: 44px 40px 38px;
    border-radius: 22px;
    background: linear-gradient(
        165deg,
        rgba(36, 36, 52, 0.97) 0%,
        var(--bg-card) 42%,
        rgba(22, 22, 34, 0.98) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 32px 64px rgba(0, 0, 0, 0.5);
}

.auth-page--immersive .auth-tabs {
    max-width: 640px;
    margin-bottom: 24px;
}

.auth-page--immersive .auth-card-title {
    font-size: 26px;
    letter-spacing: -0.03em;
}

.auth-page--immersive .auth-card-subtitle {
    font-size: 15px;
    margin-bottom: 30px;
    max-width: 36em;
    margin-left: auto;
    margin-right: auto;
}

.auth-page--immersive .auth-method-grid {
    gap: 18px;
    margin-bottom: 30px;
}

.auth-page--immersive .auth-method-tile {
    min-height: 142px;
    padding: 28px 18px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.14);
    background: linear-gradient(180deg, rgba(48, 48, 68, 0.45) 0%, var(--bg-secondary) 100%);
    transition: transform 0.28s ease, border-color 0.2s ease, box-shadow 0.28s ease, background 0.2s ease;
}

.auth-page--immersive .auth-method-tile:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

.auth-page--immersive .auth-stepper {
    margin-bottom: 32px;
}

.auth-page--immersive .auth-stepper::before {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(80, 85, 110, 0.5) 50%,
        transparent 100%
    );
    opacity: 0.95;
}

.auth-page--immersive .auth-input {
    padding: 16px 16px;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page--immersive .auth-btn-primary,
.auth-page--immersive .auth-btn-primary.auth-btn-gold,
.auth-page--immersive .auth-btn-primary.auth-btn-gold-hover {
    padding: 16px 22px;
    border-radius: 14px;
    font-size: 16px;
    letter-spacing: 0.02em;
}

.auth-page--immersive .auth-btn-gold {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.auth-page--immersive .auth-btn-gold-hover:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}

@media (prefers-reduced-motion: reduce) {
    .auth-tabs-slider {
        transition: none !important;
    }
    .auth-page--immersive .auth-method-tile:hover {
        transform: none;
    }
}

.auth-telegram-cta {
    margin-bottom: 12px;
}

.auth-telegram-secondary-link {
    text-align: center;
    margin: 0 0 8px;
}

.auth-hint-centered {
    text-align: center;
    margin-bottom: 0;
}

.auth-footer-spaced {
    margin-top: 12px;
}

.auth-footer-tight {
    margin-top: 8px;
}

.auth-tabs {
    display: flex;
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-bottom: 22px;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 22px;
    background: linear-gradient(
        165deg,
        rgba(36, 36, 52, 0.97) 0%,
        var(--bg-card) 42%,
        rgba(22, 22, 34, 0.98) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 32px 64px rgba(0, 0, 0, 0.5);
}

.auth-tabs-slider {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc(50% - 5px);
    border-radius: 17px;
    background: linear-gradient(180deg, #f2dc6a 0%, #e4c34a 18%, #d4af37 55%, #a88628 100%);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.35),
        0 1px 0 rgba(255, 255, 255, 0.35) inset;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.85, 1);
    z-index: 0;
    pointer-events: none;
}

.auth-tabs[data-active="register"] .auth-tabs-slider {
    transform: translateX(100%);
}

.auth-tabs .auth-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    padding: 13px 16px;
    border-radius: 17px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: block;
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: rgba(190, 205, 230, 0.55);
    transition: color 0.2s ease;
}

.auth-tabs .auth-tab:hover {
    color: rgba(220, 230, 245, 0.88);
}

.auth-tabs .auth-tab.is-active {
    color: #1a1508;
    font-weight: 700;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-tabs .auth-tab:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.7);
    outline-offset: 2px;
}

.auth-card {
    width: 100%;
    max-width: 640px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 36px 32px 32px;
    box-shadow: var(--shadow);
}

.auth-card-visual {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.auth-card-visual:not(.auth-card-visual--user-avatar) svg {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px;
    max-height: 28px;
    display: block;
    flex-shrink: 0;
    stroke: var(--accent-gold);
    fill: none;
    color: var(--accent-gold);
}

.auth-card-visual--user-avatar .auth-avatar-emoji {
    display: block;
    font-size: 30px;
    line-height: 1;
    user-select: none;
    filter: contrast(1.08) sepia(1) saturate(2.65) hue-rotate(6deg) brightness(0.97) contrast(1.12) brightness(1.06);
}

.auth-card-title--after-stepper {
    margin-top: 4px;
}

.auth-card-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.auth-card-subtitle {
    font-size: 14px;
    text-align: center;
    color: var(--text-muted);
    margin: 0 0 28px;
    line-height: 1.45;
}

.auth-method-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-method-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-method-tile:hover {
    border-color: rgba(212, 175, 55, 0.45);
    background: var(--bg-hover);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.auth-method-tile svg {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px;
    max-height: 32px;
    display: block;
    flex-shrink: 0;
    stroke: var(--accent-gold);
    fill: none;
}

.auth-card-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.auth-card-footer a {
    color: var(--accent-gold);
    text-decoration: underline;
    font-weight: 600;
}

.auth-card-footer a:hover {
    color: var(--accent-gold-hover);
}

/* Степпер регистрации */
.auth-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    position: relative;
    padding: 0 4px;
}

.auth-stepper::before {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 16px;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.auth-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 25%;
}

.auth-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}

.auth-step.is-done .auth-step-circle {
    background: rgba(46, 160, 67, 0.25);
    border-color: #2ea043;
    color: #2ea043;
}

.auth-step.is-done .auth-step-circle svg {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
    display: block;
    stroke: #2ea043;
}

.auth-step.is-active .auth-step-circle {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-dark);
}

.auth-step-label {
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
    color: var(--text-muted);
    line-height: 1.25;
    max-width: 72px;
}

.auth-step.is-active .auth-step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-step.is-done .auth-step-label {
    color: var(--text-secondary);
}

.auth-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.auth-input {
    width: 100%;
    padding: 14px 14px;
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.65);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.18);
}

.auth-field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
}

.auth-btn-primary {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #3a3a48 0%, #252530 100%);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: filter 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.auth-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.auth-btn-gold {
    background: linear-gradient(180deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
    color: #1a1508;
    border-color: rgba(212, 175, 55, 0.5);
}

.auth-btn-gold:hover {
    filter: brightness(1.05);
}

.auth-btn-primary.auth-btn-gold-hover {
    background: linear-gradient(
        152deg,
        #3e3e52 0%,
        #2d2d3c 38%,
        #1a1a24 100%
    );
    border-color: rgba(212, 175, 55, 0.14);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition:
        background 0.28s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.28s cubic-bezier(0.34, 1.1, 0.64, 1),
        box-shadow 0.28s ease;
}

.auth-btn-primary.auth-btn-gold-hover:hover {
    color: #1a1508;
    border-color: rgba(212, 175, 55, 0.55);
    transform: scale(1.03);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    background: linear-gradient(180deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn-primary.auth-btn-gold-hover:hover {
        transform: none;
    }
}

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid rgba(255, 80, 110, 0.45);
    background: rgba(202, 52, 80, 0.15);
    color: #ffd8df;
}

.auth-link-muted {
    color: var(--accent-gold);
    font-size: 14px;
    text-decoration: underline;
}

.auth-telegram-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.auth-telegram-icon-wrap svg {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px;
    max-height: 28px;
    display: block;
    fill: none;
    stroke: var(--accent-gold);
}

@media (max-width: 480px) {
    .auth-method-grid {
        grid-template-columns: 1fr;
    }
    .auth-card {
        padding: 24px 18px 22px;
    }
    .auth-page--immersive {
        padding: 32px 16px 64px;
    }
    .auth-page--immersive .auth-card {
        padding: 32px 20px 28px;
    }
}
