/* =============================================================================
   FORMULARIO DE REGISTRO
   Modal, inputs, validaciones y mensajes
   ============================================================================= */

/* --- MODAL OVERLAY --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 51, 102, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- MODAL CONTAINER --- */
.modal {
    background: var(--color-white);
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

/* --- MODAL HEADER --- */
.modal-header {
    background: linear-gradient(135deg, var(--color-primary), #004d7a);
    color: var(--color-white);
    padding: 30px;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.modal-header h2 {
    color: var(--color-white);
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover, .modal-close:focus {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* --- MODAL BODY --- */
.modal-body {
    padding: 40px 30px;
}

/* --- FORM GROUPS --- */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background: var(--color-white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* --- VALIDACIÓN --- */
.form-group.error .form-input,
.form-group.error .form-select {
    border-color: #e74c3c;
}

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

.form-error {
    display: none;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

.form-group.error .form-error {
    display: block;
}

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

/* --- INPUT ICONS --- */
.form-group-with-icon {
    position: relative;
}

.form-group-with-icon .form-input {
    padding-left: 45px;
}

.form-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    opacity: 0.5;
}

/* --- CHECKBOX Y TÉRMINOS --- */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.9rem;
    color: var(--color-text);
    margin: 0;
    cursor: pointer;
}

.form-checkbox a {
    color: var(--color-secondary);
    text-decoration: underline;
}

/* --- BOTONES DEL FORMULARIO --- */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--color-secondary), #45a049);
    color: var(--color-white);
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-headings);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-submit:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 3px;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid var(--color-white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* --- MENSAJE DE ÉXITO --- */
.success-message {
    display: none;
    text-align: center;
    padding: 40px 30px;
}

.success-message.active {
    display: block;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--color-secondary), #45a049);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: var(--color-white);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-message h3 {
    color: var(--color-primary);
    margin-bottom: 15px;
}

.success-message p {
    color: var(--color-text);
    margin-bottom: 25px;
}

/* --- HELPER TEXT --- */
.form-help {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .modal {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .modal-header {
        padding: 25px 20px;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 30px 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-cancel {
        order: 2;
    }

    .btn-submit {
        order: 1;
    }
}

/* =============================================================================
   BARRA DE PROGRESO
   ============================================================================= */
.progress-container {
    margin-bottom: 25px;
    padding: 0 5px;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary), #45a049);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-fill.complete {
    background: linear-gradient(90deg, #45a049, var(--color-secondary));
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

/* =============================================================================
   SECCIONES DEL FORMULARIO
   ============================================================================= */
.form-section {
    margin-bottom: 30px;
}

.form-section-title {
    font-family: var(--font-headings);
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section-title i {
    color: var(--color-secondary);
    font-size: 1.2rem;
}

/* =============================================================================
   TELÉFONO CON CÓDIGO DE PAÍS
   ============================================================================= */
.phone-input-group {
    display: flex;
    gap: 10px;
}

.phone-code-select {
    flex: 0 0 130px;
    font-size: 0.9rem;
}

.phone-number-input {
    flex: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .phone-input-group {
        flex-direction: column;
    }

    .phone-code-select {
        flex: 1;
        width: 100%;
    }
}

/* =============================================================================
   RADIO CARDS (PAYMENT/RECEPTION METHODS)
   ============================================================================= */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 10px 0;
}

.radio-card {
    position: relative;
    display: block;
    padding: 0;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.radio-card:hover {
    border-color: var(--color-secondary);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card:has(input[type="radio"]:checked) {
    border-color: var(--color-secondary);
    background: #e8f5e9;
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    background: transparent;
}

.radio-card input[type="radio"]:checked + .radio-card-content::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--color-secondary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    text-align: center;
    gap: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.radio-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.radio-card-text {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.95rem;
    line-height: 1.3;
}

.radio-card-subtext {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.2;
}

/* Responsive para radio cards */
@media (max-width: 480px) {
    .radio-cards {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   INFORMACIÓN DE DEPÓSITO
   ============================================================================= */
.info-deposito {
    background: #f8f9fa;
    border: 2px solid var(--color-secondary);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.info-deposito h4 {
    color: var(--color-primary);
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-deposito h4 i {
    color: var(--color-secondary);
}

.info-copiable {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #e0e0e0;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    min-width: 100px;
}

.info-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    flex: 1;
    color: var(--color-primary);
    font-size: 0.95rem;
    word-break: break-all;
}

.btn-copy {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-copy:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-copy:active {
    transform: scale(0.95);
}

.btn-copy.copied {
    background: #2196F3;
}

.btn-copy i {
    font-size: 0.9rem;
}

/* QR Code para USDT */
.qr-code-container {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.qr-code-container img {
    max-width: 200px;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.qr-code-container p {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Responsive para info de depósito */
@media (max-width: 480px) {
    .info-copiable {
        flex-direction: column;
        align-items: stretch;
    }

    .info-label {
        min-width: auto;
    }

    .btn-copy {
        width: 100%;
        justify-content: center;
    }
}
