/* =====================================================
   ESTILOS - FORMULARIO ADWORDS
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Contenedor principal */
.form-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

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

/* Header */
.form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.form-header h1 {
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-header p {
    opacity: 0.9;
    font-size: 1em;
}

/* Formulario */
#formulario {
    padding: 30px;
}

/* Selector de modo */
.mode-selector {
    margin-bottom: 25px;
}

.mode-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 0.95em;
}

.mode-buttons {
    display: flex;
    gap: 15px;
}

.mode-btn {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mode-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.mode-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.mode-icon {
    font-size: 1.5em;
}

.mode-btn span:last-child {
    font-weight: 600;
    font-size: 0.9em;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.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 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Campos condicionales */
.conditional-fields {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.conditional-fields.visible {
    max-height: 500px;
    opacity: 1;
    margin-top: 25px;
}

.conditional-group {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    background: #fafafa;
}

/* Checkboxes */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9em;
    color: #555;
    line-height: 1.5;
}

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

.checkmark {
    display: inline-block;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border: 2px solid #888;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    margin-top: 2px;
    background: white;
    vertical-align: top;
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "\2713";
    position: absolute;
    top: 0;
    left: 4px;
    color: white;
    font-size: 16px;
    font-weight: bold;
    line-height: 18px;
}

.checkbox-label a {
    color: #667eea;
    text-decoration: none;
}

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

/* Mensajes de error */
.error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.8em;
    margin-top: 6px;
    min-height: 18px;
}

/* Botón de envío */
.submit-btn {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

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

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Footer */
.form-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: left;
}

.form-footer p {
    font-size: 0.8em;
    color: #888;
    line-height: 1.5;
}

/* Estados de validación */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e74c3c;
    background: #fff5f5;
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #4CAF50;
    background: #f5fff5;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .form-container {
        border-radius: 15px;
    }
    
    .form-header {
        padding: 25px 20px;
    }
    
    .form-header h1 {
        font-size: 1.5em;
    }
    
    #formulario {
        padding: 20px;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        flex-direction: row;
        justify-content: center;
    }
}
