body.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Отключение автозаполнения для всех полей на страницах auth, кроме login */
body.auth-page:not(.login-page) input:not([autocomplete]),
body.auth-page:not(.login-page) textarea:not([autocomplete]),
body.auth-page:not(.login-page) select:not([autocomplete]) {
    autocomplete: off;
    -webkit-autocomplete: off;
}

/* Декоративные элементы как на главной */
body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255, 7, 58, 0.08) 0%, 
        rgba(255, 7, 58, 0.04) 15%, 
        transparent 30%,
        transparent 70%,
        rgba(255, 7, 58, 0.04) 85%,
        rgba(255, 7, 58, 0.08) 100%);
    z-index: -1;
    pointer-events: none;
}

body.auth-page::after {
    content: '';
    position: fixed;
    top: -150px;
    left: -150px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 7, 58, 0.05), transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    z-index: 1;
}

.auth-brand-logo {
    display: block;
    width: auto;
    max-width: min(100%, 640px);
    height: 5.6rem;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(255, 7, 58, 0.35));
}

.auth-card {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    z-index: 1;
    margin-bottom: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 30px;
    font-weight: 600;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-card p.subtitle {
    margin: 0 0 30px;
    color: #9ca3af;
}

.auth-card label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #d1d5db;
}

.auth-card input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    max-width: 100%;
}

.auth-card input:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.85);
}

.auth-card input:focus {
    border-color: #6366f1;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.auth-card button.primary {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.auth-card button.secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

.auth-card button.secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.auth-card .links {
    margin-top: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.auth-card .links a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 500;
}

.auth-card .alert {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
    border-left-width: 4px;
    border-left-style: solid;
}

.auth-card .alert.info {
    background: rgba(37, 99, 235, 0.22);
    border: 1px solid rgba(96, 165, 250, 0.45);
    border-left-color: #60a5fa;
    color: #dbeafe;
}

.auth-card .alert.error {
    background: rgba(220, 38, 38, 0.22);
    border: 1px solid rgba(248, 113, 113, 0.45);
    border-left-color: #f87171;
    color: #fee2e2;
}

.auth-card .alert.success {
    background: rgba(22, 163, 74, 0.22);
    border: 1px solid rgba(74, 222, 128, 0.45);
    border-left-color: #4ade80;
    color: #dcfce7;
}

.auth-card small {
    display: block;
    margin-top: -12px;
    margin-bottom: 14px;
    color: #fca5a5;
    font-size: 12px;
}

.personal-data-consent {
    margin-top: 4px;
    margin-bottom: 4px;
}

.personal-data-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.personal-data-label input[type="checkbox"] {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    width: auto;
    height: auto;
    box-shadow: none;
    background: transparent;
    flex-shrink: 0;
    align-self: flex-start;
}

.personal-data-label span {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.personal-data-label a {
    color: #a5b4fc;
    text-decoration: underline;
    font-weight: 500;
}

.auth-card input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.5);
}

.auth-card button:disabled:not(.loading) {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Индикатор загрузки */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
    transform-origin: center center;
    flex-shrink: 0;
    position: relative;
    top: 0;
    left: 0;
}

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

.auth-card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.auth-card button.loading {
    position: relative;
    color: transparent;
}

.auth-card button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    transform-origin: center center;
}

.verify-section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 24px;
    padding-top: 24px;
    display: none;
}

.verify-section.active {
    display: block;
}

.resend-btn {
    font-size: 14px;
    padding: 10px 14px;
}

.resend-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Мобильная оптимизация */
@media (max-width: 768px) {
    body.auth-page {
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .auth-logo {
        margin-bottom: 20px;
    }
    
    .auth-brand-logo {
        height: 4.4rem;
        max-width: min(100%, 520px);
    }
    
    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    .auth-card h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .auth-card p.subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .auth-card label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .auth-card input {
        padding: 14px 16px;
        font-size: 16px; /* Предотвращает зум на iOS */
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .auth-card button.primary {
        padding: 16px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .auth-card button.secondary {
        padding: 14px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
        min-height: 48px;
    }
    
    .resend-btn {
        font-size: 14px;
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
    }
    
    .code-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .code-row input,
    .code-row button {
        width: 100%;
        box-sizing: border-box;
    }
    
    .auth-card .links {
        font-size: 13px;
        margin-top: 16px;
        line-height: 1.6;
    }
    
    .auth-card .links a {
        display: inline-block;
        margin-top: 4px;
    }
    
    .auth-footer {
        margin-top: 20px;
        padding: 15px 10px;
        font-size: 0.85rem;
    }
    
    .auth-footer p {
        margin: 6px 0;
        line-height: 1.5;
    }
}

/* Small phones */
@media (max-width: 480px) {
    body.auth-page {
        padding: 8px;
    }
    
    .auth-logo {
        margin-bottom: 15px;
    }
    
    .auth-brand-logo {
        height: 3.7rem;
        max-width: min(100%, 420px);
    }
    
    .auth-card {
        padding: 20px 16px;
        max-width: 100%;
        width: 100%;
    }
    
    .auth-card h1 {
        font-size: 22px;
        margin-bottom: 6px;
    }
    
    .auth-card p.subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    
    .auth-card label {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .auth-card input {
        font-size: 16px;
        padding: 14px;
        min-height: 48px;
    }
    
    .auth-card button.primary,
    .auth-card button.secondary {
        font-size: 16px;
        padding: 14px;
        min-height: 48px;
    }
    
    .auth-card .alert {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 16px;
    }
    
    .auth-card .links {
        font-size: 12px;
    }
    
    .auth-footer {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}

.auth-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    z-index: 1;
}

.auth-footer p {
    margin: 8px 0;
}

.auth-footer .external-link,
.auth-footer .email-link {
    color: #6366f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-footer .external-link:hover,
.auth-footer .email-link:hover {
    color: #818cf8;
    text-decoration: underline;
}

.auth-footer .footer-email {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Very small phones */
@media (max-width: 360px) {
    body.auth-page {
        padding: 6px;
    }
    
    .auth-brand-logo {
        height: 3.1rem;
        max-width: min(100%, 320px);
    }
    
    .auth-card {
        padding: 18px 14px;
    }
    
    .auth-card h1 {
        font-size: 20px;
    }
    
    .auth-card p.subtitle {
        font-size: 12px;
    }
    
    .auth-card input {
        padding: 12px;
        font-size: 16px;
        min-height: 44px;
    }
    
    .auth-card button.primary,
    .auth-card button.secondary {
        padding: 12px;
        font-size: 15px;
        min-height: 44px;
    }
    
    .auth-card .alert {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .auth-footer {
        padding: 10px 6px;
        font-size: 0.75rem;
    }
}

html[data-theme="light"] body.auth-page {
    background: linear-gradient(135deg, #eef3f8 0%, #e2ebf4 100%);
    color: #1e293b;
}

html[data-theme="light"] body.auth-page::before {
    background: linear-gradient(90deg,
        rgba(185, 28, 28, 0.05) 0%,
        rgba(185, 28, 28, 0.02) 18%,
        transparent 32%,
        transparent 68%,
        rgba(185, 28, 28, 0.02) 82%,
        rgba(185, 28, 28, 0.05) 100%);
}

html[data-theme="light"] body.auth-page::after {
    background: radial-gradient(circle, rgba(30, 64, 175, 0.08), transparent 70%);
}

html[data-theme="light"] .auth-brand-logo {
    filter: drop-shadow(0 0 12px rgba(185, 28, 28, 0.18));
}

html[data-theme="light"] .auth-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .auth-card h1,
html[data-theme="light"] .auth-card label,
html[data-theme="light"] .auth-card .links,
html[data-theme="light"] .auth-card .links a,
html[data-theme="light"] .auth-card small {
    color: #1e293b;
}

html[data-theme="light"] .auth-card p.subtitle,
html[data-theme="light"] .auth-footer,
html[data-theme="light"] .auth-footer .footer-email {
    color: #64748b;
}

html[data-theme="light"] .auth-card .alert {
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .auth-card .alert.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    border-color: #93c5fd;
    border-left-color: #2563eb;
}

html[data-theme="light"] .auth-card .alert.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    border-color: #fca5a5;
    border-left-color: #dc2626;
}

html[data-theme="light"] .auth-card .alert.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #15803d;
    border-color: #86efac;
    border-left-color: #16a34a;
}

html[data-theme="light"] .auth-card input {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .auth-card input:hover,
html[data-theme="light"] .auth-card input:focus {
    background: #ffffff;
}

html[data-theme="light"] .auth-card button.secondary {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

html[data-theme="light"] .auth-card button.secondary:hover {
    background: #e2e8f0;
}

html[data-theme="light"] .auth-footer .external-link,
html[data-theme="light"] .auth-footer .email-link {
    color: #b91c1c;
}
