/* =====================================================
   SLOTLY AUTH - СТИЛИ АВТОРИЗАЦИИ v2
   ===================================================== */

:root {
    --bg-dark: #0a0a0f;
    --bg-primary: #12121a;
    --bg-secondary: #1a1a25;
    --bg-tertiary: #22222f;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --accent-color: #a855f7;
    --accent-hover: #9333ea;
    --gradient-primary: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    --gradient-client: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --gradient-business: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --gradient-telegram: linear-gradient(135deg, #0088cc 0%, #00aaff 100%);
    --gradient-vk: linear-gradient(135deg, #4c75a3 0%, #5181b8 100%);
    --gradient-email: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    --gradient-phone: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    position: relative;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* Welcome Screen */
.welcome-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 24px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.welcome-logo {
    text-align: center;
    margin-bottom: 48px;
}

.logo-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-tagline {
    font-size: 16px;
    color: var(--text-secondary);
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 48px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.feature i {
    width: 48px;
    height: 48px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-color);
}

.feature span {
    font-size: 12px;
    color: var(--text-secondary);
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
}

.btn-primary,
.btn-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px 24px;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-client);
    color: white;
    box-shadow: 0 10px 40px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(168, 85, 247, 0.4);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

.btn-primary i,
.btn-secondary i {
    font-size: 24px;
    margin-bottom: 4px;
}

.btn-hint {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
}

.welcome-footer {
    text-align: center;
}

.welcome-footer p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.trust-badges span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.trust-badges i {
    color: var(--success);
}

/* Auth Container */
.auth-container {
    flex: 1;
    padding: 24px;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.back-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--bg-secondary);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header.compact {
    margin-bottom: 24px;
}

.auth-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.auth-icon.client {
    background: var(--gradient-client);
}

.auth-icon.business {
    background: var(--gradient-business);
}

.auth-icon.verify {
    background: var(--gradient-primary);
}

.auth-icon.email {
    background: var(--gradient-email);
}

.auth-icon.phone {
    background: var(--gradient-phone);
}

.auth-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Quick Auth Section */
.quick-auth-section {
    margin-bottom: 24px;
}

.quick-auth-section h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

.messenger-buttons {
    display: flex;
    gap: 12px;
}

.messenger-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.messenger-btn i {
    font-size: 28px;
}

.messenger-btn.telegram {
    background: var(--gradient-telegram);
    box-shadow: 0 8px 30px rgba(0, 136, 204, 0.3);
}

.messenger-btn.telegram:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 136, 204, 0.4);
}

.messenger-btn.vk {
    background: var(--gradient-vk);
    box-shadow: 0 8px 30px rgba(76, 117, 163, 0.3);
}

.messenger-btn.vk:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(76, 117, 163, 0.4);
}

.messenger-btn.google {
    background: linear-gradient(135deg, #ea4335 0%, #fbbc05 50%, #34a853 100%);
    box-shadow: 0 8px 30px rgba(234, 67, 53, 0.3);
}

.messenger-btn.google:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(234, 67, 53, 0.4);
}

/* Auth Method Buttons */
.email-auth-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-method-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.auth-method-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.method-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.method-icon.email {
    background: var(--gradient-email);
}

.method-icon.phone {
    background: var(--gradient-phone);
}

.method-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.method-title {
    font-size: 15px;
    font-weight: 600;
}

.method-desc {
    font-size: 12px;
    color: var(--text-tertiary);
}

.auth-method-btn > i.fa-chevron-right {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}

.auth-divider span {
    padding: 0 16px;
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 32px;
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

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

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

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: var(--bg-glass);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-glass);
}

.tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.tab.active {
    background: var(--gradient-primary);
    color: white;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form.hidden {
    display: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.half {
    flex: 1;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon > i {
    position: absolute;
    left: 16px;
    font-size: 16px;
    color: var(--text-tertiary);
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.input-with-icon select {
    appearance: none;
    cursor: pointer;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
}

.input-with-icon input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.forgot-link {
    align-self: flex-end;
    font-size: 13px;
    color: var(--accent-color);
    text-decoration: none;
    margin-top: -8px;
}

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-color);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label a {
    color: var(--accent-color);
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Business Benefits */
.business-benefits {
    margin-top: 28px;
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.business-benefits h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.business-benefits h3 i {
    color: var(--warning);
}

.business-benefits ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.business-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.business-benefits li i {
    color: var(--success);
    font-size: 14px;
}

.business-benefits li strong {
    color: var(--success);
}

/* Telegram Notify Hint */
.telegram-notify-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.2);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.telegram-notify-hint i {
    font-size: 24px;
    color: #0088cc;
    flex-shrink: 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 32px;
    max-width: 380px;
    width: 100%;
    position: relative;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.modal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-content > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Code Inputs */
.code-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.code-input {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    background: var(--bg-glass);
    border: 2px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.code-input:focus {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
}

/* Resend Code */
.resend-code {
    text-align: center;
    margin-top: 24px;
}

.resend-code span {
    font-size: 14px;
    color: var(--text-secondary);
}

.resend-code button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.resend-code button:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--success);
}

.toast.success::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.error::before {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--error);
}

/* Loading State */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading span {
    display: none;
}

.btn-submit.loading i {
    display: none;
}

.btn-submit.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 420px) {
    .welcome-container,
    .auth-container {
        padding: 20px 16px;
    }

    .logo-icon {
        width: 80px;
        height: 80px;
        font-size: 36px;
    }

    .logo-text {
        font-size: 36px;
    }

    .welcome-features {
        gap: 16px;
    }

    .feature i {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 16px 20px;
        font-size: 16px;
    }

    .code-input {
        width: 50px;
        height: 56px;
        font-size: 24px;
    }

    .messenger-btn {
        padding: 16px 12px;
    }

    .messenger-btn i {
        font-size: 24px;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }
}
