/* Variables para tema oscuro (por defecto) */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --input-bg: #1e293b;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Variables para tema claro */
body:not(.dark-mode) {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #cbd5e1;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --input-bg: #ffffff;
    --shadow: 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-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Logo dentro del formulario */
.form-card .logo-container {
    text-align: center;
    margin-bottom: 32px;
}

.form-card .logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Mostrar/ocultar logos según el tema */
.dark-mode .form-card .logo-light {
    display: none;
}

.dark-mode .form-card .logo-dark {
    display: block;
    margin: 0 auto;
}

body:not(.dark-mode) .form-card .logo-light {
    display: block;
    margin: 0 auto;
}

body:not(.dark-mode) .form-card .logo-dark {
    display: none;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    z-index: 10;
}

.theme-toggle:hover {
    transform: scale(1.05);
    border-color: var(--accent-color);
}

.dark-mode .sun-icon {
    display: none;
}

.dark-mode .moon-icon {
    display: block;
}

body:not(.dark-mode) .sun-icon {
    display: block;
}

body:not(.dark-mode) .moon-icon {
    display: none;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 4px 6px var(--shadow);
    position: relative;
    overflow: visible;
}

.form-card-large {
    max-width: 600px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    text-align: center;
}

.form-description {
    text-align: center;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Sistema de pasos */
.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

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

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

.step.active .step-circle {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.step.active ~ .step-line,
.step.active ~ .step .step-circle {
    /* Pasos futuros mantienen el estilo por defecto */
}

/* Paso completado */
.step.completed .step-circle {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.step-line.completed {
    background: #10b981;
}

/* Paso 2 - Verificación de código */
.verification-info {
    text-align: center;
    margin-bottom: 32px;
}

.verification-message {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.verification-submessage {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.code-inputs-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.code-input {
    width: 50px !important;
    height: 60px;
    padding: 0 !important;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 14px;
}

.resend-container {
    text-align: center;
    margin-top: 20px;
}

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

.resend-text a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.resend-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Paso 3 - Carga de fotos */
.photo-step {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.photo-step.active-step {
    display: block;
    animation: slideInRight 0.5s ease forwards;
}

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

.photo-step.slide-out {
    animation: slideOutLeft 0.5s ease forwards;
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

.photo-instructions {
    text-align: center;
    margin-bottom: 32px;
}

.photo-icon {
    margin: 0 auto 20px;
    color: var(--accent-color);
}

.photo-icon svg {
    stroke: var(--accent-color);
}

.photo-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.photo-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.photo-tips {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    max-width: 350px;
    margin: 0 auto;
}

.photo-tips li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 0;
    padding-left: 24px;
    position: relative;
}

.photo-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.upload-area {
    margin-bottom: 24px;
}

.upload-label {
    display: block;
    width: 100%;
    padding: 60px 20px;
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.upload-label:hover {
    border-color: var(--accent-color);
    background: var(--bg-primary);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.preview-area {
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-area img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    margin: 0 auto 16px auto;
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
    object-fit: contain;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.btn-change {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-color);
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin: 0 auto;
}

.btn-change:hover {
    background: var(--accent-color);
    color: white;
}

/* Form styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group:has(.custom-select.open) {
    overflow: visible;
    z-index: 9999;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-align: center;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
    color: var(--text-secondary);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    line-height: 1.5;
}

body:not(.dark-mode) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

select option {
    background: var(--input-bg);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 16px;
}

/* Custom select para países con banderas */
.custom-select {
    position: relative;
    width: 100%;
    z-index: 9999;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover {
    border-color: var(--accent-color);
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 350px;
    z-index: 10000;
    display: none;
    box-shadow: 0 8px 24px var(--shadow);
    overflow: hidden;
}

.custom-select.open .custom-select-options {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

/* Buscador dentro del dropdown */
.custom-select-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}

.custom-select-search input {
    width: 100%;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.custom-select-search input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.custom-select-search svg {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Lista de opciones con scroll */
.custom-select-options-list {
    overflow-y: auto;
    max-height: 280px;
}

.custom-select-option {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
}

.custom-select-option:hover {
    background: var(--bg-primary);
}

.custom-select-option.hidden {
    display: none;
}

.custom-select-option .fi {
    font-size: 20px;
    width: 28px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Scrollbar personalizado para lista de países */
.custom-select-options-list::-webkit-scrollbar {
    width: 8px;
}

.custom-select-options-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.custom-select-options-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.custom-select-options-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Campos extranjero */
.extranjero-fields {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.5s ease, margin-top 0.5s ease;
    overflow: hidden;
}

.extranjero-fields.show {
    max-height: 800px;
    opacity: 1;
    margin-top: 0;
    overflow: visible;
}

/* Terms and Conditions - Modern Checkbox */
.terms-container {
    margin: 2rem 0 1.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.terms-container:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Ocultar checkbox nativo */
.terms-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Checkbox personalizado */
.terms-checkbox .checkmark {
    position: relative;
    height: 24px;
    min-width: 24px;
    width: 24px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terms-checkbox:hover .checkmark {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

/* Icono de check */
.terms-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    top: 3px;
}

/* Cuando está checked */
.terms-checkbox input[type="checkbox"]:checked ~ .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    animation: checkBounce 0.3s ease;
}

.terms-checkbox input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

/* Animación del check */
@keyframes checkBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Texto de términos */
.terms-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.terms-text a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.terms-text a:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.terms-text a:hover {
    opacity: 0.8;
}

.terms-text a:hover:after {
    transform: scaleX(1);
}

.btn-submit {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* Ocultar badge de reCAPTCHA (permitido si se muestra el texto de términos) */
.grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* International Telephone Input - Estilos personalizados */
.iti {
    width: 100%;
    display: block;
}

.iti__input {
    width: 100%;
    padding: 12px 16px 12px 58px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.iti__input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--bg-primary);
}

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

/* Selector de país */
.iti__selected-flag {
    background-color: transparent;
    padding: 0 8px 0 16px;
    border-right: 1px solid var(--border-color);
    border-radius: 6px 0 0 6px;
    overflow: hidden;
}

.iti__selected-flag:hover,
.iti__selected-flag:focus {
    background-color: var(--bg-primary);
    border-radius: 6px 0 0 6px;
}

/* Bandera en sí - redondear las esquinas */
.iti__flag {
    border-radius: 3px;
    overflow: hidden;
}

.iti__selected-flag .iti__flag {
    border-radius: 3px;
}

/* Fondo de la bandera seleccionada */
.iti__selected-country-primary {
    border-radius: 4px;
    overflow: hidden;
}

/* Variables para modo oscuro de intl-tel-input */
body.dark-mode .iti {
    --iti-border-color: #374151;
    --iti-dialcode-color: #9ca3af;
    --iti-dropdown-bg: #1f2937;
    --iti-arrow-color: #9ca3af;
    --iti-hover-color: #374151;
}

/* Dropdown de países */
.iti__country-list {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 200px;
}

/* Cada país en la lista */
.iti__country-list .iti__country {
    padding: 8px 16px;
}

/* País actualmente seleccionado (con checkmark azul) */
.iti__country-list .iti__country.iti__active {
    background-color: var(--accent-color) !important;
    color: white !important;
}

.iti__selected-country {
    background-color: var(--accent-color) !important;
    color: white !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

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

.iti__search-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px;
    width: calc(100% - 16px);
}

.iti__search-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.iti__search-input::placeholder {
    color: var(--text-secondary);
}

/* Texto del país */
.iti__country-name,
.iti__dial-code {
    color: var(--text-primary);
}

/* Flecha del dropdown */
.iti__arrow {
    border-top-color: var(--text-primary);
}

.iti__arrow--up {
    border-bottom-color: var(--text-primary);
}

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

.recaptcha-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.recaptcha-text a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.recaptcha-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.login-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.login-text a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.login-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Responsive design - Mobile */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .form-card .logo {
        height: 50px;
    }

    .form-card .logo-container {
        margin-bottom: 24px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        top: 16px;
        right: 16px;
    }

    .form-card {
        padding: 32px 24px;
        border-radius: 12px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .steps-container {
        margin-bottom: 24px;
        padding: 0 10px;
    }

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

    .step-line {
        width: 30px;
    }

    .verification-info {
        margin-bottom: 24px;
    }

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

    .verification-submessage {
        font-size: 12px;
    }

    .code-inputs-container {
        gap: 8px;
    }

    .code-input {
        width: 45px !important;
        height: 55px;
        font-size: 22px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    input {
        padding: 10px 14px;
        font-size: 16px; /* Mantener 16px para evitar zoom en iOS */
    }

    .btn-submit {
        padding: 12px 20px;
    }

    .footer-text {
        margin-top: 24px;
        padding-bottom: 20px;
    }

    .recaptcha-text {
        font-size: 11px;
        padding: 10px 12px;
        margin-bottom: 20px;
    }

    .login-text {
        font-size: 13px;
    }

    .photo-title {
        font-size: 20px;
    }

    .photo-description {
        font-size: 14px;
    }

    .photo-tips li {
        font-size: 13px;
    }

    .upload-label {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 40px;
    }

    .upload-text {
        font-size: 15px;
    }

    .preview-area img {
        max-height: 300px;
    }
}

@media (max-width: 380px) {
    .form-card {
        padding: 24px 16px;
    }

    h1 {
        font-size: 22px;
    }
}

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

.form-card {
    animation: fadeIn 0.4s ease;
}

/* Loader para análisis de documentos */
.analysis-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

body:not(.dark-mode) .analysis-loader {
    background: rgba(241, 245, 249, 0.95);
}

.analysis-loader.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.loader-content {
    text-align: center;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px var(--shadow);
    max-width: 400px;
    margin: 0 20px;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estado de éxito del loader */
.loader-success {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s ease;
}

.loader-success svg {
    width: 35px;
    height: 35px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.loader-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.loader-title.success {
    color: #10b981;
}

.loader-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.loader-message.success {
    color: #10b981;
}

.loader-dots {
    display: inline-block;
    width: 20px;
    text-align: left;
}

.loader-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Responsive para el loader */
@media (max-width: 640px) {
    .loader-content {
        padding: 32px 24px;
    }

    .loader-spinner {
        width: 50px;
        height: 50px;
    }

    .loader-success {
        width: 50px;
        height: 50px;
    }

    .loader-success svg {
        width: 30px;
        height: 30px;
    }

    .loader-title {
        font-size: 18px;
    }

    .loader-message {
        font-size: 14px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast.toast-success {
    border-color: #10b981;
}

.toast.toast-error {
    border-color: #ef4444;
}

.toast.toast-info {
    border-color: #3b82f6;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    animation: shrinkProgress 4s linear;
}

.toast-success .toast-progress {
    color: #10b981;
}

.toast-error .toast-progress {
    color: #ef4444;
}

.toast-info .toast-progress {
    color: #3b82f6;
}

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

@keyframes shrinkProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Mobile adjustments for toast */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* File Upload Styles */
.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-upload:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.btn-upload svg {
    width: 20px;
    height: 20px;
}

.file-name {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: center;
    word-break: break-all;
}

.file-name.uploaded {
    color: var(--success);
    font-weight: 500;
}

/* ============================================
   Error States for Form Validation
   ============================================ */

/* Error state for form fields */
.field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Error banner */
.error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 12px;
    margin-bottom: 24px;
    border-left: 4px solid #ef4444;
    animation: slideInDown 0.3s ease;
}

.dark-mode .error-banner {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border-left-color: #ef4444;
}

.error-banner svg {
    flex-shrink: 0;
}

.error-banner span {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 9998;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    color: white;
}

/* Tooltip para WhatsApp */
.whatsapp-float::before {
    content: '¿Tenés alguna duda?';
    position: absolute;
    right: 70px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 12px var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.whatsapp-float:hover::before {
    opacity: 1;
    right: 75px;
}

/* Responsive para mobile */
@media (max-width: 768px) {
    /* Terms checkbox responsive */
    .terms-container {
        padding: 1rem;
        margin: 1.5rem 0 1rem;
    }

    .terms-text {
        font-size: 14px;
    }

    .terms-checkbox {
        gap: 0.75rem;
    }

    .whatsapp-float {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }

    .whatsapp-float::before {
        display: none;
    }
}

/* ============================================
   Scrollbar personalizado moderno
   ============================================ */

/* Para navegadores basados en Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 120, 120, 0.5);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:active {
    background: rgba(120, 120, 120, 0.7);
}

/* Scrollbar para modo oscuro */
.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(200, 200, 200, 0.3);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(200, 200, 200, 0.5);
}

.dark-mode ::-webkit-scrollbar-thumb:active {
    background: rgba(200, 200, 200, 0.7);
}

/* Scrollbar en la esquina (cuando hay horizontal y vertical) */
::-webkit-scrollbar-corner {
    background: transparent;
}

/* Para Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 120, 0.3) transparent;
}

.dark-mode * {
    scrollbar-color: rgba(200, 200, 200, 0.3) transparent;
}

/* Estado de advertencia del loader */
.loader-warning {
    width: 60px;
    height: 60px;
    margin: 0 auto 24px;
    background: #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s ease;
}

.loader-warning svg {
    width: 35px;
    height: 35px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.loader-title.warning {
    color: #f59e0b;
}

.loader-message.warning {
    color: #f59e0b;
}

/* Modal de error de selfie */
.selfie-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:not(.dark-mode) .selfie-error-modal {
    background: rgba(241, 245, 249, 0.95);
}

.selfie-error-modal.active {
    display: flex;
    opacity: 1;
}

.selfie-error-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px var(--shadow);
    text-align: center;
    animation: scaleIn 0.4s ease;
}

.selfie-error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.4s ease;
}

.selfie-error-icon svg {
    width: 45px;
    height: 45px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.selfie-error-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.selfie-error-content > p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.selfie-tips {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.selfie-tips h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.selfie-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.selfie-tips li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 24px;
    position: relative;
}

.selfie-tips li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.selfie-error-content .btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.selfie-error-content .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.selfie-error-content .btn-primary:active {
    transform: translateY(0);
}

/* Responsive para el modal de error de selfie */
@media (max-width: 640px) {
    .selfie-error-content {
        padding: 32px 24px;
    }

    .selfie-error-icon {
        width: 70px;
        height: 70px;
    }

    .selfie-error-icon svg {
        width: 38px;
        height: 38px;
    }

    .selfie-error-content h3 {
        font-size: 20px;
    }

    .selfie-error-content > p {
        font-size: 14px;
    }

    .selfie-tips {
        padding: 16px;
    }

    .selfie-tips h4 {
        font-size: 15px;
    }

    .selfie-tips li {
        font-size: 13px;
    }

    .loader-warning {
        width: 50px;
        height: 50px;
    }

    .loader-warning svg {
        width: 30px;
        height: 30px;
    }
}
