/**
 * Estilos para el formulario principal [pc_formulario_principal]
 * Diseño moderno con card blanca y estilos similares al formulario de producción
 */

/* ===== CONTENEDOR PRINCIPAL ===== */
.pc-formulario-container {
    max-width: 550px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== FORMULARIO CARD ===== */
.pc-formulario-principal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 25px;
    border: 1px solid #e0e0e0;
}

/* ===== CAMPOS DEL FORMULARIO ===== */
.form-field {
    margin-bottom: 15px;
}

.form-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f8f9fa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: #ff8c00;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.form-field input::placeholder {
    color: #999;
    font-weight: 400;
}

.form-field input.error {
    border-color: #f44336;
    background: #ffebee;
}

.form-field input.error:focus {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

/* ===== CAMPO DE TELÉFONO ===== */
.phone-field {
    position: relative;
    margin-bottom: 15px;
}

.phone-field .input-container {
    display: flex;
    align-items: center;
}

.phone-prefix {
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
    font-weight: 500;
    background: #f8f9fa;
}

.phone-field #pc_telefono {
    border-radius: 0 8px 8px 0;
    flex: 1;
    padding-left: 10px;
    border-left: none;
}

.phone-field #pc_telefono:focus {
    border-left: none;
}

.phone-field #pc_telefono:focus + .phone-prefix,
.phone-field:focus-within .phone-prefix {
    border-color: #ff8c00;
    background: #ffffff;
}

/* ===== BOTÓN SIGUIENTE ===== */
.btn-siguiente {
    width: 100%;
    background: #ff8c00;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-siguiente:hover {
    background: #e67c00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

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

.btn-siguiente.loading {
    background: #ff8c00;
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-siguiente:disabled,
.btn-siguiente.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-siguiente:disabled:hover,
.btn-siguiente.disabled:hover {
    background: #ccc;
    transform: none;
    box-shadow: none;
}

/* ===== RECAPTCHA CONTAINER ===== */
.recaptcha-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.recaptcha-placeholder {
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    padding: 14px 12px;
    width: 304px;
    height: 78px;
    position: relative;
    font-family: Roboto, arial, sans-serif;
    box-sizing: border-box;
}

.recaptcha-placeholder input[type="checkbox"] {
    width: 25px;
    height: 25px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #1c4587;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
}

.recaptcha-placeholder label {
    flex: 1;
    font-size: 14px;
    color: #222;
    cursor: pointer;
    margin: 0;
    user-select: none;
    font-weight: 400;
}

.recaptcha-logo {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: Roboto, arial, sans-serif;
}

.recaptcha-logo::before {
    content: "reCAPTCHA";
    font-size: 10px;
    color: #555;
    font-weight: 400;
    line-height: 1;
    margin-bottom: 2px;
}

.recaptcha-logo::after {
    content: "Privacidad - Términos";
    font-size: 8px;
    color: #1a73e8;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.recaptcha-logo::after:hover {
    text-decoration: underline;
}

/* Icono oficial de Google reCAPTCHA */
.recaptcha-placeholder::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    background: url('../img/recaptcha.png') no-repeat center;
    background-size: contain;
}

/* ===== CHECKBOX SOAP ===== */
.form-checkbox {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 0;
    background: transparent;
    border: none;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #ff8c00;
}

.form-checkbox label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    margin: 0;
    font-weight: 500;
    user-select: none;
}

/* ===== LOADING STATE ===== */
.loading-state {
    text-align: center;
    padding: 20px;
}

.loading-state .btn-siguiente {
    background: #ff8c00;
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.loading-state .btn-siguiente::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== ERRORES ===== */
.pc-form-error {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #d32f2f;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* ===== ERRORES ESPECÍFICOS PARA TELÉFONO ===== */
.phone-field .field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .pc-formulario-container {
        padding: 15px;
        max-width: 100%;
    }
    
    .pc-formulario-principal {
        padding: 20px;
    }
    
    .recaptcha-placeholder {
        min-width: 280px;
        font-size: 13px;
    }
    
    .form-field input {
        font-size: 16px; /* Evitar zoom en iOS */
    }
}

@media (max-width: 480px) {
    .pc-formulario-principal {
        padding: 15px;
    }
    
    .recaptcha-placeholder {
        min-width: 260px;
        padding: 10px 12px;
    }
}