﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary, #141414);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.auth-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f5f5f5 0%, #d0d0d0 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 40px) scale(0.9);
    }
}

.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(17, 17, 17, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-logo-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
}

.logo span {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #8A2BE1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.auth-header h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-header p {
    color: #888;
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.message.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

.message.info {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.3s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.input-wrapper input::placeholder {
    color: #666;
}

.input-wrapper input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(26, 26, 26, 0.95);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
                0 4px 16px rgba(0, 0, 0, 0.3);
}

.input-wrapper input:focus + .input-icon {
    stroke: #ffffff;
}

/* select для секретного вопроса — повторяет стиль input'ов */
.input-wrapper select {
    width: 100%;
    padding: 14px 48px 14px 48px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 18px center;
    cursor: pointer;
}

.input-wrapper select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(26, 26, 26, 0.95);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1),
                0 4px 16px rgba(0, 0, 0, 0.3);
}

.input-wrapper select option {
    background: #1a1a1a;
    color: #fff;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password svg {
    stroke: #888;
}

.field-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
}

.checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-wrapper input:checked ~ .checkmark {
    background: linear-gradient(135deg, #ffffff 0%, #d0d0d0 100%);
    border-color: transparent;
}

.checkbox-wrapper input:checked ~ .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #1a1a1a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-label {
    color: #888;
    font-size: 14px;
    user-select: none;
}

.checkbox-label a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.checkbox-label a:hover {
    color: #d0d0d0;
    text-decoration: underline;
}

.forgot-password {
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.forgot-password:hover {
    color: #d0d0d0;
    text-decoration: underline;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border: none;
    border-radius: 14px;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.3);
}

.submit-btn:hover::before {
    opacity: 1;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn svg {
    transition: transform 0.3s ease;
}

.submit-btn:hover svg {
    transform: translateX(4px);
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.auth-divider span {
    background: rgba(17, 17, 17, 0.85);
    padding: 0 16px;
    color: #666;
    font-size: 14px;
    position: relative;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(26, 26, 26, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.social-btn:hover {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.social-btn:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-footer p {
    color: #888;
    font-size: 14px;
}

.signup-link {
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.signup-link:hover {
    color: #d0d0d0;
    text-decoration: underline;
}

/* Messages */
.messages {
    margin-bottom: 24px;
}

.message {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    animation: slideDown 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .logo span {
        font-size: 28px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Loading state */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.submit-btn.loading span {
    opacity: 0.8;
}

.submit-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   Block modal — показывается, когда пользователь пытается войти
   в заблокированный аккаунт. Объясняет причину блокировки.
   ========================================== */
.block-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.block-modal.hidden { display: none; }
.block-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}
.block-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 440px;
    padding: 28px 26px 24px;
    color: #f0f0f0;
    text-align: center;
    animation: blockModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes blockModalIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.block-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
}
.block-modal-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #ef4444;
}
.block-modal-subtitle {
    margin: 0 0 18px;
    color: #aaa;
    font-size: 14px;
}
.block-modal-subtitle strong { color: #f0f0f0; }
.block-modal-reason-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    text-align: left;
}
.block-modal-reason {
    text-align: left;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
    color: #fca5a5;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    margin-bottom: 20px;
}
.block-modal-close-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.block-modal-close-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}



/* ==========================================
   Terms of Service modal — реальный текст условий
   использования, открывается со страницы регистрации.
   ========================================== */
.terms-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.terms-modal.hidden { display: none; }

.terms-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.terms-modal-content {
    position: relative;
    background: linear-gradient(145deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f0f0f0;
    animation: termsModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes termsModalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.terms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 26px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.terms-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #f0f0f0;
}
.terms-modal-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.terms-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f0f0;
}

.terms-modal-body {
    overflow-y: auto;
    padding: 22px 28px;
    flex: 1;
    line-height: 1.6;
    font-size: 14.5px;
    color: #ccc;
}
.terms-modal-body p {
    margin: 0 0 12px;
}
.terms-modal-body h3 {
    margin: 22px 0 10px;
    font-size: 16px;
    font-weight: 700;
    color: #f0f0f0;
}
.terms-modal-body ul {
    margin: 0 0 14px;
    padding-left: 22px;
}
.terms-modal-body li {
    margin-bottom: 6px;
}
.terms-modal-body a {
    color: #93c5fd;
    text-decoration: none;
}
.terms-modal-body a:hover { text-decoration: underline; }
.terms-meta {
    color: #777;
    font-size: 13px;
    margin-bottom: 16px !important;
}
.terms-footer-note {
    margin-top: 24px !important;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid #93c5fd;
    border-radius: 6px;
    color: #ddd;
    font-style: italic;
}

/* Скроллбар модалки */
.terms-modal-body::-webkit-scrollbar { width: 8px; }
.terms-modal-body::-webkit-scrollbar-track { background: transparent; }
.terms-modal-body::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
.terms-modal-body::-webkit-scrollbar-thumb:hover { background: #444; }

.terms-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 14px 26px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.terms-modal-accept {
    background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.terms-modal-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
    .terms-modal { padding: 0; }
    .terms-modal-content {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    .terms-modal-header { padding: 14px 18px; }
    .terms-modal-title { font-size: 16px; }
    .terms-modal-body { padding: 18px; font-size: 14px; }
}
