/* ПОТОК — страницы входа, регистрации, восстановления пароля */

.auth-layout {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    color: var(--potok-text, #1a1a1a);
    background: #eef1f6;
}

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(165deg, #f4f6fa 0%, #e8ecf4 45%, #e2e8f0 100%);
}

.auth-bg__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.55;
}

.auth-bg__blob--1 {
    width: min(420px, 55vw);
    height: min(420px, 55vw);
    top: -12%;
    left: -8%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.35) 0%, transparent 70%);
}

.auth-bg__blob--2 {
    width: min(380px, 50vw);
    height: min(380px, 50vw);
    bottom: -10%;
    right: -6%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.32) 0%, transparent 70%);
}

.auth-bg__blob--3 {
    width: min(280px, 40vw);
    height: min(280px, 40vw);
    top: 42%;
    right: 18%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.22) 0%, transparent 70%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 20px 48px rgba(15, 23, 42, 0.08);
    padding: 36px 32px 28px;
    box-sizing: border-box;
}

.auth-card .potok-logo-link--auth,
.auth-card .potok-brand-lockup--auth {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 24px;
}

.auth-hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.14));
    color: #3b82f6;
}

.auth-hero-icon svg {
    width: 28px;
    height: 28px;
}

.auth-heading {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: #111827;
    letter-spacing: -0.02em;
}

.auth-subtext {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    color: #6b7280;
}

.auth-subtext--italic {
    font-style: italic;
}

.auth-subtext--trial {
    margin-top: -4px;
    margin-bottom: 22px;
    font-size: 13px;
    color: #9ca3af;
}

.auth-subtext--ref {
    margin-top: -12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #2563eb;
    font-weight: 500;
}

.auth-divider-dotted {
    border: none;
    border-top: 1px dashed #e5e7eb;
    margin: 0 0 22px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label,
.auth-field__label-row label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.auth-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.auth-field__label-row label {
    margin-bottom: 0;
}

.auth-field__label-row a {
    font-size: 13px;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
    white-space: nowrap;
}

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

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap .auth-input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
}

.auth-input-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px 12px 42px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.4;
    color: #111827;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.auth-input-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.auth-input-wrap input:disabled {
    background: #f9fafb;
    color: #9ca3af;
}

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

.auth-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.auth-password-toggle:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-password-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-btn-primary {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: var(--potok-gradient, linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%));
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
}

.auth-btn-primary:hover:not(:disabled) {
    opacity: 0.96;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.32);
}

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

.auth-btn-primary.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.auth-btn-primary.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.65s linear infinite;
}

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

.auth-alert {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    border-radius: 12px;
}

.auth-alert.visible {
    display: block;
}

.auth-alert--error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.auth-alert--success {
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.auth-info-box {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #047857;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
}

.auth-info-box.visible {
    display: flex;
}

.auth-info-box__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: #10b981;
}

.auth-legal {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
    color: #9ca3af;
}

.auth-legal a {
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal a:hover {
    color: #3b82f6;
}

.auth-footer {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.auth-footer__or {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    color: #9ca3af;
}

.auth-toast-host {
    position: fixed;
    z-index: 9999;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.auth-toast {
    padding: 14px 16px;
    border-radius: 14px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.auth-toast--show {
    opacity: 1;
    transform: translateY(0);
}

.auth-footer a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
}

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

.auth-form.is-submitted .auth-field,
.auth-form.is-submitted .auth-btn-primary {
    opacity: 0.55;
    pointer-events: none;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 22px;
        border-radius: 16px;
    }

    .auth-password-row {
        grid-template-columns: 1fr;
    }

    .auth-heading {
        font-size: 20px;
    }
}
