/* ===========================================
   STONE.ES INTERNATIONAL CONTACT FORM - CSS
   Noto Sans: 400 (regular), 700 (bold)
   =========================================== */

/* Variables de diseño */
:root {
    --stone-primary: #1a237e;
    --stone-secondary: #283593;
    --stone-accent: #0066cc;
    --stone-light: #f8f9fa;
    --stone-dark: #212529;
    --stone-border: #e0e0e0;
    --stone-success: #28a745;
    --stone-error: #dc3545;
    --stone-warning: #ffc107;
    --stone-info: #17a2b8;
}

/* Reset y base */
.stone-es-international-form {
    font-family: 'Noto Sans', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

/* Selector de idioma */
.language-selector {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--stone-light);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--stone-border);
    background: white;
    border-radius: 30px;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--stone-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    border-color: var(--stone-primary);
    background: var(--stone-light);
}

.lang-btn.active {
    background: var(--stone-primary);
    border-color: var(--stone-primary);
    color: white;
}

.lang-flag {
    font-size: 18px;
}

/* Encabezado del formulario */
.form-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--stone-light);
}

.form-header h2 {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: var(--stone-primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.form-header p {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--stone-dark);
    opacity: 0.8;
}

/* Layout de columnas */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Columnas */
.form-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Secciones */
.form-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid var(--stone-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
}

.form-section h3 {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--stone-secondary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--stone-light);
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--stone-dark);
    margin-bottom: 10px;
}

.form-group label span[class*="lang-"] {
    font-weight: inherit;
}

/* Campos de entrada */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--stone-border);
    border-radius: 8px;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: var(--stone-dark);
    background: white;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select:invalid {
    font-weight: 400;
    color: #999;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--stone-accent);
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

/* Grupos de radio */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: var(--stone-light);
    transition: all 0.2s ease;
}

.radio-group label:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.radio-group input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

/* Secciones especiales */
.newsletter-section,
.gdpr-section {
    background: var(--stone-light);
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    border-left: 4px solid var(--stone-primary);
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.checkbox-group a {
    color: var(--stone-accent);
    text-decoration: none;
    font-weight: 700;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

/* Botones de acción */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--stone-light);
}

.submit-btn,
.reset-btn {
    padding: 16px 40px;
    border: none;
    border-radius: 8px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
}

.submit-btn {
    background: linear-gradient(135deg, var(--stone-primary), var(--stone-secondary));
    color: white;
    font-weight: 700;
    position: relative;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--stone-secondary), #3949ab);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 35, 126, 0.25);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.reset-btn {
    background: white;
    color: var(--stone-dark);
    border: 2px solid var(--stone-border);
    font-weight: 400;
}

.reset-btn:hover {
    background: var(--stone-light);
    border-color: #ccc;
}

/* Spinner de carga */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: stoneSpin 1s ease-in-out infinite;
    margin-left: 12px;
}

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

/* Mensajes de respuesta */
.form-response {
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

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

.success-message,
.error-message {
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
}

.error-message {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
}

.success-icon,
.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.success-message h3,
.error-message h3 {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 15px;
}

.success-message p,
.error-message p {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
}

.success-message h3 { color: #155724; }
.error-message h3 { color: #721c24; }

/* Estados de validación */
.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid:not(:focus),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--stone-error);
}

/* Responsive móvil */
@media (max-width: 768px) {
    .stone-es-international-form {
        padding: 15px;
        margin: 10px;
    }
    
    .form-header h2 {
        font-size: 26px;
    }
    
    .form-header p {
        font-size: 16px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .form-section h3 {
        font-size: 20px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .submit-btn,
    .reset-btn {
        width: 100%;
        padding: 14px 20px;
    }
    
    .language-selector {
        justify-content: center;
    }
}

/* Impresión */
@media print {
    .stone-es-international-form {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .form-actions,
    .language-selector {
        display: none;
    }
/* ===========================================
   ESTILOS DE ERROR - MEJORADOS
   =========================================== */

/* Campos con error */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #dc3545 !important;
    background-color: #fff8f8;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.1);
}

.form-group.has-error .radio-group,
.form-group.has-error .checkbox-group {
    border: 2px solid #dc3545;
    padding: 10px;
    border-radius: 8px;
    background-color: #fff8f8;
}

/* Mensajes de error específicos */
.field-error {
    display: none;
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    font-weight: 400;
    padding: 8px 12px;
    background-color: #fff8f8;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
    animation: fadeIn 0.3s ease;
}

.field-error:before {
    content: "⚠️ ";
    margin-right: 5px;
}

/* Indicador visual para campos requeridos */
.form-group label[for]::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Estados de validación en tiempo real */
.form-group input:valid:not(:placeholder-shown),
.form-group select:valid,
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: #28a745;
    background-color: #f8fff9;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group select:invalid,
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
    background-color: #fff8f8;
}

/* Animación para errores */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group.has-error {
    animation: shake 0.5s ease;
}

/* ===========================================
   ANIMACIONES Y FEEDBACK VISUAL
   =========================================== */

/* Animación de envío exitoso */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes confettiFall {
    0% { 
        transform: translateY(-100px) rotate(0deg); 
        opacity: 0; 
    }
    10% { opacity: 1; }
    100% { 
        transform: translateY(500px) rotate(360deg); 
        opacity: 0; 
    }
}

/* Botón con animación de envío */
.submit-btn.sending {
    position: relative;
    overflow: hidden;
}

.submit-btn.sending:after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Checkmark animado */
.checkmark-container {
    display: inline-block;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #28a745;
    stroke-miterlimit: 10;
    margin: 0 auto;
    box-shadow: inset 0px 0px 0px #28a745;
    animation: fill .4s ease-in-out .4s forwards, 
               scale .3s ease-in-out .9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #28a745;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}

@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}

@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 40px #28a745; }
}

/* Confeti para éxito */
.confetti {
    position: fixed;
    width: 15px;
    height: 15px;
    background-color: #f0f;
    top: -10px;
    opacity: 0;
    z-index: 9999;
    pointer-events: none;
}

.confetti:nth-child(1) { background-color: #f0f; left: 10%; }
.confetti:nth-child(2) { background-color: #0ff; left: 20%; animation-delay: 0.2s; }
.confetti:nth-child(3) { background-color: #ff0; left: 30%; animation-delay: 0.4s; }
.confetti:nth-child(4) { background-color: #f00; left: 40%; animation-delay: 0.6s; }
.confetti:nth-child(5) { background-color: #0f0; left: 50%; animation-delay: 0.8s; }
.confetti:nth-child(6) { background-color: #00f; left: 60%; animation-delay: 1s; }
.confetti:nth-child(7) { background-color: #f0f; left: 70%; animation-delay: 1.2s; }
.confetti:nth-child(8) { background-color: #0ff; left: 80%; animation-delay: 1.4s; }
.confetti:nth-child(9) { background-color: #ff0; left: 90%; animation-delay: 1.6s; }

/* Notificación tipo toast */
.form-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 20px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-left: 5px solid #28a745;
    z-index: 10000;
    display: none;
    animation: slideInRight 0.5s ease, fadeOut 0.5s ease 4.5s forwards;
    max-width: 350px;
}

.form-notification.error {
    border-left-color: #dc3545;
}

.form-notification-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.form-notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.form-notification.success .form-notification-icon {
    color: #28a745;
}

.form-notification.error .form-notification-icon {
    color: #dc3545;
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Progress bar para envío */
.progress-container {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 15px;
    display: none;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #0052a3);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

}