/* =====================================================
   ESTILOS - FORMULARIO INDEX2 (Estilo formulario viejo)
   ===================================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #dddddd;
    min-height: 100vh;
}

/* Contenedor principal */
.form-container {
    width: 100%;
    max-width: 100%;
}

/* Formulario */
#formulario {
    padding: 15px;
    background: #dddddd;
}

/* Imagen de cabecera */
#formulario > img:first-of-type {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

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

.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: #008db8;
    background: #f8f9ff;
}

.mode-btn.active {
    border-color: #008db8;
    background: #008db8;
    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: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95em;
}

/* Input fields estilo formulario viejo */
.input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.input-field:focus {
    outline: none;
    border-color: #008db8;
    background: white;
    box-shadow: 0 0 0 2px rgba(0, 141, 184, 0.2);
}

/* 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: 15px;
}

.conditional-group {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: #f5f5f5;
}

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    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: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border: 2px solid #888;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    margin-top: 2px;
    background: white;
    vertical-align: top;
    flex-shrink: 0;
}

.checkbox-label:hover .checkmark {
    border-color: #008db8;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #008db8;
    border-color: #008db8;
}

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

.checkbox-label a {
    color: #008db8;
    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: 5px;
    min-height: 16px;
}

/* Botón de envío */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #008db8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    margin-bottom: 15px;
}

.submit-btn:hover {
    background: #006d96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 141, 184, 0.3);
}

.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: 15px;
    background: #dddddd;
    text-align: left;
}

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

.form-footer a {
    color: #008db8;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

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

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

/* Responsive */
@media (max-width: 600px) {
    #formulario {
        padding: 10px;
    }
    
    .mode-buttons {
        flex-direction: column;
    }
    
    .mode-btn {
        flex-direction: row;
        justify-content: center;
    }
}
