/* WEB-DS — страницы входа и регистрации */
.auth-wrap {
    min-height: calc(100vh - var(--header-height, 64px) - var(--mobile-nav-height, 0px));
    display: flex;
    flex-direction: column;
    background: var(--primary-bg);
}

@media (min-width: 769px) {
    body:has(.auth-wrap) {
        padding-bottom: 0;
    }
}

.auth-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 960px) {
    .auth-wrap {
        align-items: center;
        justify-content: center;
        padding: 24px 20px;
        background:
            radial-gradient(circle at 15% 20%, rgba(67, 97, 238, 0.08) 0%, transparent 42%),
            radial-gradient(circle at 85% 80%, rgba(90, 24, 154, 0.06) 0%, transparent 40%),
            var(--primary-bg);
    }

    .auth-layout {
        grid-template-columns: 340px minmax(0, 1fr);
        max-width: 940px;
        width: 100%;
        min-height: auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow:
            0 24px 48px rgba(67, 97, 238, 0.12),
            0 4px 16px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(67, 97, 238, 0.1);
    }
}

/* —— Левая панель —— */
.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 24px 22px 26px;
    background: linear-gradient(155deg, #2f42b8 0%, #4361ee 45%, #6a11cb 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 960px) {
    .auth-brand {
        padding: 28px 24px;
        min-height: 100%;
    }
}

/* Декоративная сетка */
.auth-brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 85%);
    pointer-events: none;
}

.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: authOrbFloat 8s ease-in-out infinite;
}

.auth-brand::before {
    width: 200px;
    height: 200px;
    top: -50px;
    right: -40px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 68%);
}

.auth-brand::after {
    width: 160px;
    height: 160px;
    bottom: -30px;
    left: -30px;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.18) 0%, transparent 70%);
    animation-delay: -4s;
}

@keyframes authOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6px, -8px) scale(1.04); }
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.auth-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    text-decoration: none;
    color: #fff;
}

.auth-brand-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    line-height: 0;
}

.auth-brand-logo img {
    height: 38px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
    background: transparent;
    padding: 0;
    border-radius: 0;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.25));
    mix-blend-mode: screen;
}

/* Если логотип тёмный / без белого фона — нормальный режим */
.auth-brand-logo-mark--solid img {
    mix-blend-mode: normal;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.auth-brand-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.auth-brand-logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.auth-brand-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

@media (min-width: 960px) {
    .auth-brand-title {
        font-size: 1.38rem;
    }
}

.auth-brand-desc {
    margin: 0 0 16px;
    font-size: 0.82rem;
    line-height: 1.5;
    opacity: 0.9;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.95;
}

.auth-features li i {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auth-stat {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
}

.auth-stat strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.2;
}

.auth-stat span {
    font-size: 0.66rem;
    opacity: 0.82;
    line-height: 1.3;
}

.auth-brand-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.auth-brand-links a {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s ease, transform 0.2s ease;
}

.auth-brand-links a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(-1px);
}

/* —— Правая панель (форма) —— */
.auth-form-side {
    display: flex;
    align-items: flex-start;
    justify-content: stretch;
    padding: 24px 20px 32px;
    background: var(--secondary-bg);
    width: 100%;
    min-width: 0;
}

@media (min-width: 960px) {
    .auth-form-side {
        align-items: center;
        padding: 32px 36px;
        background: var(--secondary-bg);
    }
}

.auth-card {
    width: 100%;
    max-width: none;
    flex: 1;
    min-width: 0;
}

.auth-card-head {
    margin-bottom: 22px;
}

.auth-card-head h1 {
    margin: 0 0 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.auth-card-head p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.45;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-dark);
    font-size: 0.84rem;
}

.auth-form .form-label .required {
    color: var(--accent-danger);
}

.auth-form .form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--secondary-bg);
    color: var(--text-dark);
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}

.auth-form .form-input::placeholder {
    color: var(--text-light);
}

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

.auth-input-wrap > i.field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.88rem;
    pointer-events: none;
}

.auth-input-wrap .form-input {
    padding-left: 40px;
}

.auth-input-wrap .form-input.has-toggle {
    padding-right: 42px;
}

.auth-toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.auth-toggle-pw:hover {
    color: var(--accent-primary);
    background: rgba(67, 97, 238, 0.08);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-medium);
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.auth-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-submit {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 14px rgba(67, 97, 238, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(67, 97, 238, 0.4);
}

.auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.auth-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.86rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.84rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.auth-alert i {
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-alert--error {
    background: rgba(239, 71, 111, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 71, 111, 0.2);
}

.auth-alert--success {
    background: rgba(6, 214, 160, 0.1);
    color: #059669;
    border: 1px solid rgba(6, 214, 160, 0.25);
}

.auth-alert--info {
    background: rgba(67, 97, 238, 0.08);
    color: var(--accent-primary);
    border: 1px solid rgba(67, 97, 238, 0.18);
}

.auth-secure-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-light);
}

.auth-secure-note i {
    color: var(--accent-success);
}

/* Индикатор сложности пароля */
.auth-pw-strength {
    margin-top: 8px;
}

.auth-pw-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--border-color);
    overflow: hidden;
    margin-bottom: 8px;
}

.auth-pw-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.3s ease, background 0.3s ease;
}

.auth-pw-bar-fill--weak { width: 25%; background: #ef476f; }
.auth-pw-bar-fill--fair { width: 50%; background: #ff9e00; }
.auth-pw-bar-fill--good { width: 75%; background: #4361ee; }
.auth-pw-bar-fill--strong { width: 100%; background: #06d6a0; }

.auth-pw-label {
    font-size: 0.76rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-light);
}

.auth-pw-label span {
    color: var(--text-medium);
}

.auth-pw-rules {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

@media (max-width: 480px) {
    .auth-pw-rules {
        grid-template-columns: 1fr;
    }
}

.auth-pw-rules li {
    font-size: 0.74rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-pw-rules li i {
    font-size: 0.65rem;
    width: 14px;
    text-align: center;
}

.auth-pw-rules li.valid {
    color: #059669;
}

.auth-pw-rules li.valid i {
    color: #059669;
}

.auth-pw-match {
    font-size: 0.76rem;
    margin-top: 6px;
    display: none;
}

.auth-pw-match.visible {
    display: flex;
    align-items: center;
    gap: 6px;
}

.auth-pw-match.ok { color: #059669; }
.auth-pw-match.bad { color: var(--accent-danger); }

/* Тип аккаунта (регистрация) */
.auth-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.auth-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    background: var(--primary-bg);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
}

.auth-type-card i {
    font-size: 1.25rem;
    color: var(--accent-primary);
}

.auth-type-card strong {
    font-size: 0.82rem;
    color: var(--text-dark);
}

.auth-type-card small {
    font-size: 0.68rem;
    color: var(--text-light);
    line-height: 1.3;
}

.auth-type-option input:checked + .auth-type-card {
    border-color: var(--accent-primary);
    background: rgba(67, 97, 238, 0.06);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.auth-type-hint {
    display: none;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(67, 97, 238, 0.06);
    font-size: 0.78rem;
    color: var(--text-medium);
}

.auth-type-hint.show {
    display: block;
}

@media (max-width: 959px) {
    .auth-brand {
        padding: 24px 20px;
    }

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

    .auth-brand-desc {
        font-size: 0.86rem;
        margin-bottom: 16px;
    }

    .auth-features {
        gap: 8px;
    }

    .auth-stats {
        display: none;
    }

    .auth-brand-links {
        margin-top: 14px;
    }
}

@media (max-width: 480px) {
    .auth-type-grid {
        grid-template-columns: 1fr;
    }
}
