:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --secondary: #ec4899;
    --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --bg: #faf9ff;
    --card-bg: #ffffff;
    --text: #1e1b2e;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 20px 60px rgba(124, 58, 237, 0.08), 0 8px 24px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 24px 70px rgba(124, 58, 237, 0.14), 0 10px 30px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Montserrat', sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 15% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Toast container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 40px);
}

.toast {
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 14px;
    animation: slideInToast 0.35s ease-out;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
    word-break: break-word;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--primary); }
.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutToast {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* Main card */
.main-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1100px;
    width: 100%;
    align-items: stretch;
    justify-content: center;
}

.info-panel {
    flex: 1 1 380px;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
}

.info-panel h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 2.6rem;
    line-height: 1.2;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.info-panel .subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
}
.badge:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
}
.badge .emoji { font-size: 16px; }

/* Form card */
.form-card {
    flex: 1 1 420px;
    max-width: 520px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    transition: var(--transition);
}
.form-card:hover { box-shadow: var(--shadow-hover); }

.form-card h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}
.form-card .form-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: 0.01em;
}
.form-group label .required {
    color: var(--error);
    font-weight: 700;
}
.hint-text {
    color: var(--text-secondary);
    font-weight: 400;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition);
    background: #fdfcff;
    color: var(--text);
}
.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.08);
    background: #ffffff;
}
.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.06);
}

.error-message {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
    font-weight: 500;
    min-height: 16px;
    transition: var(--transition);
}

/* File upload */
.file-upload-wrapper { position: relative; }
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #fdfcff;
    position: relative;
}
.file-upload-area:hover {
    border-color: var(--primary-light);
    background: #faf8ff;
}
.file-upload-area.dragover {
    border-color: var(--primary);
    background: #f3efff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.06);
}
.file-upload-area .upload-icon { font-size: 36px; margin-bottom: 8px; }
.file-upload-area p { font-size: 14px; color: var(--text-secondary); margin: 4px 0; }
.file-upload-area .hint { font-size: 12px; color: #9ca3af; }
.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f0ff;
    border: 1px solid #ddd6fe;
    border-radius: 100px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-dark);
    animation: fadeIn 0.3s ease;
}
.file-chip .chip-remove {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 4px;
    transition: color 0.2s;
}
.file-chip .chip-remove:hover { color: var(--error); }
.file-chip .chip-size {
    color: var(--text-secondary);
    font-weight: 400;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
    width: 100%;
}
.btn-primary:hover {
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.35);
    transform: translateY(-2px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 24px;
    font-size: 14px;
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #faf8ff;
    transform: translateY(-1px);
}
.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Withdraw */
.withdraw-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.withdraw-section .note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}
.withdraw-btn {
    background: #fff;
    border: 2px solid #e0d9f5;
    color: var(--primary-dark);
    padding: 12px 26px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.withdraw-btn:hover {
    border-color: var(--primary);
    background: #faf8ff;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.1);
    transform: translateY(-1px);
}
.withdraw-btn .wallet-icon { font-size: 18px; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 27, 46, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInOverlay 0.25s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay.closing { animation: fadeOutOverlay 0.2s ease forwards; }
@keyframes fadeOutOverlay { to { opacity: 0; } }

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 440px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    animation: slideUpModal 0.35s ease-out;
    position: relative;
}
@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 6px;
}
.modal .modal-sub {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.modal .modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    line-height: 1;
}
.modal .modal-close:hover { color: var(--text); }
.modal .form-group input { background: #fdfcff; }
.modal .btn-primary { margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .form-card { padding: 24px 18px; border-radius: 14px; }
    .info-panel h1 { font-size: 1.9rem; }
    .info-panel .subtitle { font-size: 0.95rem; }
    .main-wrapper { gap: 24px; padding: 10px 0; }
    .badge { font-size: 12px; padding: 8px 14px; }
    .toast-container { top: 10px; right: 10px; max-width: calc(100% - 20px); }
    .modal { padding: 24px 18px; }
}
@media (max-width: 480px) {
    body { padding: 12px; }
    .form-card { padding: 20px 14px; }
    .btn-primary { padding: 12px 20px; font-size: 14px; }
    .info-panel h1 { font-size: 1.6rem; }
}

/* ===== Видео-верификация ===== */
.verification-block {
    background: #f9f7ff;
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    text-align: center;
}
.btn-outline.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    margin-left: 10px;
}

.verification-modal {
    max-width: 500px;
    text-align: center;
}
.video-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 15px auto;
    aspect-ratio: 4/3;
    background: #1e1b2e;
    border-radius: 12px;
    overflow: hidden;
}
.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Зеркалим, как в зеркале */
}
.frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.frame-overlay .frame-face {
    width: 45%;
    height: 65%;
    border: 3px dashed var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3);
}
.frame-overlay .frame-document {
    width: 70%;
    height: 55%;
    border: 3px dashed #fbbf24;
    border-radius: 8px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3);
}
.frame-overlay .frame-face-document {
    width: 80%;
    height: 75%;
    border: 3px dashed #34d399;
    border-radius: 8px;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
.frame-face-document .face-subframe {
    width: 35%;
    height: 40%;
    border: 2px dashed rgba(167, 139, 250, 0.7);
    border-radius: 50%;
    margin-top: 10%;
}
.frame-face-document .doc-subframe {
    width: 70%;
    height: 30%;
    border: 2px dashed rgba(251, 191, 36, 0.7);
    border-radius: 4px;
    margin-bottom: 10%;
}

.recording-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.recording-indicator .dot {
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%,100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.verification-controls, .preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}
#recordedPreview video {
    width: 100%;
    max-width: 480px;
    border-radius: 8px;
    margin: 10px 0;
}