/* ==================================== */
/* 1. Estilos Generales y Contenedor */
/* ==================================== */
#optikmoda-form-container {
    max-width: 750px;
    margin: 40px auto;
    padding: 35px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(255, 140, 0, 0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-top: 6px solid #FF8C00;
}

#optikmoda-form-container h2 {
    color: #FF8C00;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.25em;
    font-weight: 700;
    border-bottom: 3px solid #FFE4CC;
    padding-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mensaje de Bienvenida */
.form-intro {
    font-size: 0.78em;
    text-align: center;
    margin-bottom: 30px;
    padding: 16px;
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE4CC 100%);
    border-radius: 10px;
    color: #CC7000;
    line-height: 1.5;
    border-left: 5px solid #FF8C00;
    font-weight: 500;
}

#optikmoda-form-container h3 {
    color: #FF8C00;
    border-left: 6px solid #FF8C00;
    padding-left: 15px;
    margin-top: 50px;
    margin-bottom: 25px;
    padding-top: 25px;
    font-size: 0.95em;
    font-weight: 700;
    background: linear-gradient(90deg, #FFF5E6 0%, transparent 100%);
    padding-bottom: 10px;
    border-radius: 0 8px 8px 0;
    border-top: 2px solid #FFE4CC;
}

#optikmoda-form-container h4 {
    color: #CC7000;
    font-size: 0.82em;
    margin-top: 30px;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid #FFB84D;
    font-weight: 600;
}

/* ==================================== */
/* 2. Estilos de Campos de Formulario */
/* ==================================== */
label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.7em;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-size: 0.75em;
    background-color: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #FF8C00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    background-color: #ffffff;
}

/* Estilo para los inputs de archivo */
input[type="file"] {
    padding: 12px 10px;
    background-color: #FFF5E6;
    border: 2px dashed #FF8C00;
    cursor: pointer;
}

input[type="file"]:hover {
    background-color: #FFE4CC;
    border-color: #CC7000;
}

/* Estilo para textarea */
textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Estilo para selects */
select {
    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='%23FF8C00' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

/* ==================================== */
/* 3. Botón de Envío */
/* ==================================== */
#submit-button {
    background: linear-gradient(135deg, #FF8C00 0%, #FF6600 100%);
    color: white;
    padding: 12px 22px;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 0.88em;
    font-weight: bold;
    margin-top: 30px;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.3);
}

#submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #CC7000 0%, #CC5200 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.4);
}

#submit-button:active:not(:disabled) {
    transform: translateY(0);
}

#submit-button:disabled {
    background: linear-gradient(135deg, #cccccc 0%, #aaaaaa 100%);
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================================== */
/* 4. Checkbox y Privacidad */
/* ==================================== */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #FFF5E6;
    border-radius: 8px;
    border: 2px solid #FFD9A6;
}

.checkbox-wrapper input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    margin-top: 4px;
    min-width: 18px;
    min-height: 18px;
    cursor: pointer;
    accent-color: #FF8C00;
}

.checkbox-wrapper label {
    font-weight: normal;
    font-size: 0.7em;
    margin-top: 0;
    display: inline;
    color: #555;
    cursor: pointer;
}

.privacy-text {
    font-size: 0.65em;
    line-height: 1.5;
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE4CC 100%);
    padding: 16px;
    border-radius: 10px;
    border: 2px solid #FFD9A6;
    margin-bottom: 15px;
    margin-top: 20px;
}

.privacy-text p {
    margin: 10px 0;
    color: #555;
}

.privacy-text strong {
    color: #FF8C00;
    font-weight: 700;
}

.pdf-instruction {
    margin-top: 25px;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #FFF5E6;
    border-left: 4px solid #FF8C00;
    border-radius: 6px;
    font-size: 0.7em;
    color: #555;
}

/* ==================================== */
/* 5. Mensajes de Estado (AJAX) */
/* ==================================== */
#form-message {
    padding: 18px;
    margin-top: 25px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}

#form-message.hidden {
    display: none;
}

#form-message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid #b1dfbb;
    box-shadow: 0 4px 10px rgba(21, 87, 36, 0.1);
}

#form-message.success h3 {
    color: #155724;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.15em;
}

#form-message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid #f5c6cb;
    box-shadow: 0 4px 10px rgba(114, 28, 36, 0.1);
}

#form-message.loading {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid #ffeaa7;
    box-shadow: 0 4px 10px rgba(133, 100, 4, 0.1);
}

/* ==================================== */
/* 6. Ajuste de Layout (Dos Columnas) */
/* ==================================== */

.flex-row-2col {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    margin-top: 10px;
}

.flex-row-2col > div {
    display: flex;
    flex-direction: column;
}

.flex-row-2col .cantidad-pagada-col {
    flex: 2;
}

.flex-row-2col .numero-nota-col {
    flex: 1;
}

.flex-row-2col input[type="number"],
.flex-row-2col input[type="text"] {
    width: 100%;
}

/* ==================================== */
/* 7. Efectos Adicionales de Modernización */
/* ==================================== */

/* Efecto hover para inputs */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="date"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
    border-color: #FFB84D;
}

/* Placeholder styling */
::placeholder {
    color: #aaa;
    opacity: 1;
}

/* Estilos para campos requeridos */
input:required:valid,
select:required:valid,
textarea:required:valid {
    border-color: #e0e0e0;
}

input:required:invalid,
select:required:invalid,
textarea:required:invalid {
    border-color: #e0e0e0;
}

/* ==================================== */
/* 8. Responsive Design */
/* ==================================== */

@media (max-width: 768px) {
    #optikmoda-form-container {
        padding: 25px;
        margin: 20px 10px;
    }

    #optikmoda-form-container h2 {
        font-size: 1.6em;
    }

    .form-intro {
        font-size: 1em;
        padding: 15px;
    }

    #optikmoda-form-container h3 {
        font-size: 1.2em;
    }
}

@media (max-width: 600px) {
    .flex-row-2col {
        flex-direction: column;
        gap: 0;
    }
    
    .flex-row-2col .cantidad-pagada-col,
    .flex-row-2col .numero-nota-col {
        flex: auto;
    }

    #submit-button {
        font-size: 1.1em;
        padding: 16px 20px;
    }
}

/* ==================================== */
/* 9. Animaciones Sutiles */
/* ==================================== */

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

#optikmoda-form-container {
    animation: fadeIn 0.5s ease-in-out;
}

/* Animación para mensajes */
#form-message:not(.hidden) {
    animation: fadeIn 0.3s ease-in-out;
}