/* Основные переменные */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --text-color: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dfe6e9;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text-color);
    line-height: 1.6;
}

/* Контейнер */
.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* Карточка верификации */
.verification-card {
    background: var(--bg-primary);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 48px;
    max-width: 500px;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.verification-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Progress Indicator */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 0;
    position: relative;
    transition: opacity 0.3s ease;
}

.progress-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.progress-step.completed .step-circle {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
    position: relative;
    font-size: 0;
}

.progress-step.completed .step-circle::before {
    content: '✓';
    position: absolute;
    font-size: 22px;
    font-weight: bold;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.step-label {
    display: none;
}

.progress-line {
    width: 80px;
    height: 2px;
    background: var(--border-color);
    position: relative;
    margin: 0 8px;
    transition: background 0.3s ease;
}

.progress-line.active {
    background: var(--secondary-color);
}

.progress-line.completed {
    background: var(--success-color);
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeInSlide 0.4s ease;
}

.step-content.active {
    display: block;
}

/* Заголовок карточки */
.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.shield-icon {
    width: 64px;
    height: 64px;
    color: var(--secondary-color);
    margin-bottom: 24px;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Форма */
.verification-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-left: 4px;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    background: var(--bg-secondary);
}

.form-group input:focus {
    border-color: var(--secondary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.form-group input.error {
    border-color: var(--error-color);
}

.form-group input.success {
    border-color: var(--success-color);
}

.error-message {
    font-size: 13px;
    color: var(--error-color);
    margin-left: 4px;
    min-height: 18px;
    display: block;
}

/* Кнопка отправки */
.submit-btn {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(52, 152, 219, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-text {
    display: inline-block;
}

/* Verification Process */
.verification-process {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--bg-secondary);
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    margin: 0 auto 32px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.verification-process h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    animation: pulse 2s ease-in-out infinite;
}

.verification-details {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.verification-steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 300px;
    margin: 0 auto;
}

.verification-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.verification-item.checking {
    opacity: 1;
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid var(--secondary-color);
    animation: pulse 1.5s ease-in-out infinite;
}

.verification-item.completed {
    opacity: 1;
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid var(--success-color);
}

.verify-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-item.checking .verify-icon {
    color: var(--secondary-color);
    animation: spin 1.5s linear infinite;
}

.verification-item.completed .verify-icon {
    color: var(--success-color);
}

.verification-item.completed .verify-icon svg {
    display: none;
}

.verification-item.completed .verify-icon::after {
    content: '✓';
    position: absolute;
    font-size: 24px;
    font-weight: bold;
    color: var(--success-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.verification-item span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
}

/* Сообщение об успехе */
.success-message {
    text-align: center;
    animation: fadeInScale 0.5s ease;
}

.success-icon {
    width: 80px;
    height: 80px;
    color: var(--success-color);
    margin-bottom: 24px;
}

.success-message h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 12px;
}

.success-message p {
    font-size: 16px;
    color: var(--text-secondary);
}

/* Сообщение об ошибке */
.failed-message {
    text-align: center;
    animation: fadeInScale 0.5s ease;
    padding: 20px;
}

.failed-icon {
    width: 80px;
    height: 80px;
    color: var(--error-color);
    margin: 0 auto 24px;
    animation: shake 0.5s ease;
}

.failed-message h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--error-color);
    margin-bottom: 12px;
}

.failed-message p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Футер */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px 20px 20px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section {
    margin-bottom: 24px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.footer-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.footer-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.separator {
    color: var(--text-secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-primary);
    margin: 20px;
    padding: 40px;
    border-radius: 24px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 24px;
}

.modal-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 24px;
    margin-bottom: 12px;
}

.modal-text p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.modal-text strong {
    color: var(--text-color);
    font-weight: 600;
}

.close {
    color: var(--text-secondary);
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: var(--text-color);
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .verification-card {
        padding: 32px 24px;
    }

    .progress-container {
        margin-top: 32px;
    }

    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .progress-step.completed .step-circle::before {
        font-size: 18px;
    }

    .progress-line {
        width: 60px;
    }

    .card-header {
        margin-bottom: 32px;
    }

    .card-header h1 {
        font-size: 24px;
    }

    .subtitle {
        font-size: 14px;
    }

    .shield-icon {
        width: 56px;
        height: 56px;
    }

    .verification-process h2 {
        font-size: 20px;
    }

    .loading-spinner {
        width: 56px;
        height: 56px;
        margin-bottom: 24px;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }

    .separator {
        display: none;
    }

    .modal-content {
        padding: 24px;
        margin: 10px;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .close {
        top: 12px;
        right: 16px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px 16px;
    }

    .verification-card {
        padding: 24px 20px;
    }

    .progress-container {
        margin-top: 24px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .progress-step.completed .step-circle::before {
        font-size: 16px;
    }

    .progress-line {
        width: 40px;
        margin: 0 4px;
    }

    .card-header {
        margin-bottom: 24px;
    }

    .card-header h1 {
        font-size: 20px;
    }

    .shield-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }

    .verification-process h2 {
        font-size: 18px;
    }

    .verification-details {
        font-size: 14px;
    }

    .verification-steps-list {
        gap: 12px;
    }

    .form-group input {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Скроллбар для модальных окон */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Кастомные стили для intl-tel-input */
.iti {
    width: 100%;
    display: block;
}

.iti * {
    box-sizing: border-box;
}

/* Контейнер с флагом */
.iti__flag-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    padding: 0;
}

.iti__selected-flag {
    display: flex;
    align-items: center;
    padding: 0 8px 0 16px;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.iti__selected-flag:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Само телефонное поле */
.iti input[type="tel"],
.iti input[type="text"] {
    padding-left: 75px !important;
    width: 100%;
}

/* Выпадающий список стран */
.iti__country-list {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--border-color);
    max-height: 250px;
    margin-top: 4px;
    background: white;
}

.iti__country {
    padding: 10px 16px;
    transition: background 0.2s ease;
}

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

.iti__country.iti__highlight {
    background: var(--bg-secondary);
}

.iti__country.iti__active {
    background: var(--secondary-color);
    color: white;
}

.iti__divider {
    border-bottom: 1px solid var(--border-color);
    margin: 4px 0;
}

.iti__dial-code {
    color: var(--text-secondary);
    margin-left: 8px;
}

.iti__country.iti__active .iti__dial-code {
    color: rgba(255, 255, 255, 0.8);
}

.iti__country-name {
    margin-left: 8px;
}

/* Стрелка выпадающего списка */
.iti__arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-secondary);
    margin-left: 6px;
    transition: all 0.3s ease;
}

.iti__selected-flag:hover .iti__arrow,
.iti--allow-dropdown input:focus + .iti__flag-container .iti__arrow {
    border-top-color: var(--secondary-color);
}

/* Поиск в списке стран */
.iti__search-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 8px 12px;
    width: calc(100% - 24px);
    outline: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

.iti__search-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Отдельный код страны */
.iti__selected-dial-code {
    margin-left: 6px;
    color: var(--text-color);
    font-weight: 500;
}

