/* Общие стили входа / регистрации / восстановления пароля.
   После правок увеличьте ?v= в login.html, register.html, forgot_password.html (тег link на auth-ui.css). */
:root {
    --auth-brand: #5868F2;
    --auth-brand-hover: #4a5ad9;
    --auth-brand-soft: rgba(88, 104, 242, 0.12);
    --auth-page-bg: #eef0f8;
    --font-body: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.auth-page {
    min-height: 100vh;
    background: var(--auth-page-bg);
    font-family: var(--font-body);
}

body.auth-page h1,
body.auth-page h2,
.auth-brand h1,
.auth-form-wrap > h2 {
    font-family: var(--font-heading);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 920px;
    display: flex;
    flex-direction: column;
    border-radius: 1.25rem;
    overflow: hidden;
    background: #fff;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 24px 48px -12px rgba(88, 104, 242, 0.18);
    animation: authFadeIn 0.35s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .auth-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 520px;
    }

    .auth-card.auth-card--reverse {
        flex-direction: row-reverse;
    }
}

.auth-brand {
    background: var(--auth-brand);
    color: #fff;
    position: relative;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 0 0 auto;
}

@media (min-width: 768px) {
    .auth-brand {
        flex: 0 0 42%;
        padding: 2.5rem 1.75rem;
        min-width: 0;
    }
}

/* Плавный «вал» между цветной панелью и формой */
.auth-brand::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(56px, 12vw, 88px);
    height: 78%;
    min-height: 280px;
    background: var(--auth-brand);
    border-radius: 50%;
    z-index: 0;
    display: none;
}

@media (min-width: 768px) {
    .auth-brand::before {
        display: block;
        right: calc(-0.5 * clamp(56px, 12vw, 88px));
    }

    .auth-card--reverse .auth-brand::before {
        right: auto;
        left: calc(-0.5 * clamp(56px, 12vw, 88px));
    }
}

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

.auth-form-wrap {
    flex: 1;
    background: #fff;
    padding: 1.75rem 1.25rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .auth-form-wrap {
        padding: 2.25rem 2.5rem 2.25rem 2rem;
    }

    .auth-card:not(.auth-card--reverse) .auth-form-wrap {
        padding-left: 2.75rem;
    }

    .auth-card--reverse .auth-form-wrap {
        padding-right: 2.75rem;
        padding-left: 2.5rem;
    }
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.auth-field {
    margin-bottom: 1rem;
}

/*
 * Поля с иконкой / «Показать»: flex-ряд (не absolute), чтобы FA-глифы
 * не «плавали» из-за метрик шрифта и line-height.
 */
.auth-input-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.625rem;
    background: #f3f4f6;
    border: 1px solid transparent;
    min-height: 2.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input-wrap:hover {
    background: #eceef2;
}

.auth-input-wrap:focus-within {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 3px var(--auth-brand-soft);
    background: #fff;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #111827;
    outline: none;
}

.auth-input::placeholder {
    color: #9ca3af;
}

/* Поле без суффикса (код из письма и т.д.): весь стиль на самом input */
.auth-field > .auth-input {
    border-radius: 0.625rem;
    background: #f3f4f6;
    border: 1px solid transparent;
    padding: 0.75rem 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-field > .auth-input:hover {
    background: #eceef2;
}

.auth-field > .auth-input:focus {
    border-color: var(--auth-brand);
    box-shadow: 0 0 0 3px var(--auth-brand-soft);
    background: #fff;
}

.auth-input-wrap .auth-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.7rem 0.35rem 0.7rem 1rem;
}

.auth-input-wrap .auth-input:focus {
    outline: none;
    box-shadow: none;
}

.auth-field-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem 0 0;
    color: #9ca3af;
    font-size: 1rem;
    line-height: 1;
    pointer-events: none;
}

.auth-field-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    line-height: 1;
}

.auth-btn-toggle {
    flex-shrink: 0;
    align-self: center;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem 0.5rem 0.25rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.auth-btn-toggle:hover {
    color: var(--auth-brand);
    background: var(--auth-brand-soft);
}

.auth-btn-primary {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--auth-brand);
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}

.auth-btn-primary:hover:not(:disabled) {
    background: var(--auth-brand-hover);
}

.auth-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s ease;
}

.auth-btn-secondary:hover {
    background: #f9fafb;
}

a.auth-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 2px solid #fff;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.65rem 1.75rem;
    border-radius: 0.625rem;
    transition: background 0.15s ease, color 0.15s ease;
}

a.auth-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.auth-link {
    color: var(--auth-brand);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}

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

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.checklist-item.valid {
    color: #16a34a;
}

.auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #475569;
    cursor: pointer;
}

.auth-consent input {
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-brand);
    cursor: pointer;
}

.auth-consent a {
    color: var(--auth-brand);
    text-decoration: none;
}

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

.auth-consent--notice {
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    cursor: default;
}

.auth-consent--notice input {
    display: none;
}

.auth-legal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    padding: 1.25rem 1rem 1.75rem;
    font-size: 0.8125rem;
}

.auth-legal-footer a {
    color: #64748b;
    text-decoration: none;
}

.auth-legal-footer a:hover {
    color: var(--auth-brand);
    text-decoration: underline;
}
