/* ==========================================================================
   CHESSOV - Страницы авторизации (новый дизайн)
   Две колонки: форма + красивый брендовый сайдбар
   ========================================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    background: white;
}

/* Левая колонка — брендовый сайдбар с градиентом */
.auth-brand {
    position: relative;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff9a76 50%, #b8a5e3 100%);
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: white;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand-logo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.auth-brand-logo-icon {
    width: 48px;
    height: 48px;
    background: white;
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.auth-brand-content {
    position: relative;
    max-width: 480px;
}

.auth-brand-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.15;
    font-weight: 600;
    margin-bottom: 20px;
    color: white;
    letter-spacing: -0.02em;
}

.auth-brand-subtitle {
    font-size: 17px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 40px;
}

.auth-brand-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    opacity: 0.95;
}

.auth-brand-features li::before {
    content: '✓';
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.auth-brand-footer {
    position: relative;
    font-size: 14px;
    opacity: 0.75;
}

.auth-brand-footer a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Правая колонка — форма */
.auth-form-col {
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    position: relative;
}

.auth-topbar {
    position: absolute;
    top: 32px;
    right: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-soft);
}

.auth-topbar .lang-switch {
    background: var(--color-bg-soft);
    border-radius: var(--radius-full);
    padding: 4px;
    display: flex;
    gap: 4px;
}

.auth-topbar .lang-switch button {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.auth-topbar .lang-switch button.active {
    background: white;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

.auth-form-header {
    margin-bottom: 36px;
}

.auth-form-header h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 10px;
}

.auth-form-header p {
    font-size: 16px;
    color: var(--color-text-soft);
}

/* Роль-селектор (сегментированный контрол) */
.role-segment {
    display: flex;
    background: var(--color-bg-soft);
    border-radius: var(--radius-full);
    padding: 5px;
    margin-bottom: 32px;
    position: relative;
}

.role-segment-item {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    z-index: 1;
}

.role-segment-item.active {
    background: white;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Улучшенные формы */
.af-group {
    margin-bottom: 18px;
}

.af-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.af-input-wrap {
    position: relative;
}

.af-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    background: white;
    font-size: 15px;
    color: var(--color-text);
    outline: none;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.af-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.af-input.with-icon {
    padding-left: 48px;
}

.af-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.af-input-action {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.af-input-action:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.af-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.af-hint.error {
    color: #e85555;
}

.af-hint.success {
    color: #2d8a78;
}

.af-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.af-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text-soft);
    cursor: pointer;
    user-select: none;
    margin-bottom: 20px;
    line-height: 1.5;
}

.af-checkbox input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.af-checkbox a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.af-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 24px;
    position: relative;
}

.af-submit.loading {
    color: transparent;
    pointer-events: none;
}

.af-submit.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -10px;
    margin-top: -10px;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.af-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 500;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.af-divider::before,
.af-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.af-google-btn {
    width: 100%;
    padding: 13px;
    background: white;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 16px;
}

.af-google-btn:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-soft);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.af-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--color-text-soft);
}

.af-switch a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

.af-switch a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* SMS код — красивые инпуты */
.sms-step-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--color-primary-soft), var(--color-tertiary-soft));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.sms-digits {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 32px 0 24px;
}

.sms-digit {
    width: 56px;
    height: 64px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-display);
    outline: none;
    transition: all var(--transition-fast);
    background: white;
    color: var(--color-text);
}

.sms-digit:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-primary-soft);
    transform: scale(1.03);
}

.sms-digit.filled {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.sms-resend {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-soft);
    margin-top: 16px;
}

.sms-resend button {
    color: var(--color-primary);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 4px;
    font-size: 14px;
}

.sms-resend button:hover { text-decoration: underline; }
.sms-resend button:disabled { color: var(--color-text-muted); cursor: not-allowed; }

.sms-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-text-muted);
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 16px;
    font-family: inherit;
}

.sms-back:hover { color: var(--color-text); }

/* Карточки типа аккаунта */
.role-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.role-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: white;
}

.role-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.role-card.active {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.role-card-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.role-card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

/* Успех */
.success-state {
    text-align: center;
    padding: 40px 20px;
}

.success-state-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #7dd3c0, #5cb8a3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 12px 32px rgba(125, 211, 192, 0.4);
    animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-state h2 {
    font-size: 26px;
    margin-bottom: 12px;
}

.success-state p {
    color: var(--color-text-soft);
    margin-bottom: 28px;
    line-height: 1.6;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Документы — зона загрузки */
.doc-upload-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.doc-upload {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
}

.doc-upload:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}

.doc-upload.has-files {
    border-color: var(--color-secondary);
    background: var(--color-secondary-soft);
    border-style: solid;
}

.doc-upload-icon {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.doc-upload-info { flex: 1; min-width: 0; }

.doc-upload-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}

.doc-upload-hint {
    font-size: 12px;
    color: var(--color-text-muted);
}

.doc-upload-count {
    font-size: 12px;
    color: var(--color-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.doc-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 960px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        padding: 40px 32px;
        min-height: 280px;
    }

    .auth-brand-title {
        font-size: 1.8rem;
    }

    .auth-brand-features {
        display: none;
    }

    .auth-brand-footer {
        display: none;
    }

    .auth-form-col {
        padding: 40px 24px;
    }

    .auth-topbar {
        top: 20px;
        right: 24px;
    }
}

@media (max-width: 480px) {
    .role-segment-item { font-size: 13px; padding: 8px 10px; }
    .af-row-2 { grid-template-columns: 1fr; }
    .sms-digit { width: 48px; height: 58px; font-size: 24px; }
    .role-cards { grid-template-columns: 1fr; }
}
