@import "../css/style.css";

/* =======================================
   CONTENEDOR PRINCIPAL
======================================= */
.container-alt {
    width: 100%;
    margin: 0rem auto;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: #111827;
}

/* =======================================
   CARD PRINCIPAL
======================================= */
.card-alt {
    background-color: var(--color-fondo-form);
    border-radius: 12px;
    box-shadow: var(--color-box-shadow-header-panel);
    padding: 2rem;
    position: relative;
    border: solid 1px var(--color-border-form-modal);
}

/* =======================================
   HEADER DE LA CARD
======================================= */
.card-alt-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-tipografia-description-form);
    font-family: var(--font-title);
}

.card-alt-header p {
    font-size: 1rem;
    color: var(--color-tipografia-description-form);
    margin-bottom: 2%;
    font-family: var(--font-base);
    font-weight: 500;
}

/* =======================================
   FORMULARIO
======================================= */
#customer-form-alt {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 6rem;
    /* espacio para footer sticky */
}

/* =======================================
   SECCIONES
======================================= */
.form-section h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--color-border-form);
    padding-bottom: 0.5rem;
    color: var(--color-tipografia-description-form);
    font-family: var(--font-title);
    font-weight: 600;
}

.field-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 1.5rem;
}

/* =======================================
   CAMPOS DE INPUT Y TEXTAREA
======================================= */
.field {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
}

.field input,
.field select,
.field textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border-form);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border 0.3s, box-shadow 0.3s;
    width: 100%;
    background-color: var(--color-input-search-header-panel);
}

.field textarea {
    resize: vertical;
}

.field label {
    font-size: 1rem;
    color: #5c5f66;
    margin-bottom: 0.25rem;
    font-family: var(--font-title);
    font-weight: 600;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #2564eb44;
}


/* =======================================
   VALIDACIONES CON BORDE + FONDO
======================================= */

/* ===== VÁLIDO ===== */
.field input.is-valid,
.field textarea.is-valid,
.field select.is-valid {
    border-color: lime;
    background-color: rgba(0, 255, 0, 0.096);
    box-shadow: none !important;
}

/* ===== INVÁLIDO ===== */
.field input.is-invalid,
.field textarea.is-invalid,
.field select.is-invalid {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.08);
    box-shadow: none !important;
}

/* Mantener color al hacer focus */
.field input.is-valid:focus,
.field textarea.is-valid:focus,
.field select.is-valid:focus,
.field input.is-invalid:focus,
.field textarea.is-invalid:focus,
.field select.is-invalid:focus {
    box-shadow: none !important;
    outline: none;
}

/* Mensajes de error debajo (refuerzo visual) */
.input-msg.msg-error {
    color: #dc2626;
}

.input-msg.msg-success {
    color: #16a34a;
}


/* Error Field */
.field-error {
    font-size: 0.8rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

/* Full width field */
.field.full {
    grid-column: 1 / -1;
}

/* =======================================
   FILE UPLOAD
======================================= */
.file-field {
    display: flex;
    flex-direction: column;
}

.file-field input[type="file"] {
    padding: 0.4rem;
    border: none;
    background: transparent;
}

.file-field label {
    margin-bottom: 0.25rem;
}

.preview {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #806b76;
}

/* =======================================
   CHECKBOXES
======================================= */
.checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

/* =======================================
   FOOTER STICKY
======================================= */
.form-footer-sticky {
    position: sticky;
    bottom: 0;
    top: 0px;
    background-color: var(--color-fondo-form);
    padding: 1rem 2rem;
    border-top: 1px solid var(--color-border-form-modal);
    display: flex;
    justify-content: flex-end;
    z-index: 999;
}

.form-footer-sticky button {
    background-color: var(--color-btn-accept);
    border: solid 1px var(--color-border-form);
    color: #fff;
    border-radius: 2rem;
    padding: 0.75rem 2rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.form-footer-sticky button:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
}



.file-area {
    border: 2px dashed var(--color-border-form-modal);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background-color: var(--color-fondo-form);
    transition: border-color 0.3s, background 0.3s;
}


.file-box:hover .file-area {
    border-color: #3b82f6;
    background-color: #2564eb1a;
}


/* =======================================
   FILE INPUT – VALIDACIÓN REAL
======================================= */

/* BASE */
.file-area {
    transition: all 0.3s ease;
}

/* ===== FILE VÁLIDO ===== */
.file-box:has(input[type="file"].is-valid) .file-area {
    border-color: #16a34a;
    background-color: rgba(22, 163, 74, 0.08);
    box-shadow: none;
}

/* ===== FILE INVÁLIDO ===== */
.file-box:has(input[type="file"].is-invalid) .file-area {
    border-color: #dc2626;
    background-color: rgba(220, 38, 38, 0.08);
    box-shadow: none;
}

/* HOVER SOLO SI NO ESTÁ EN ERROR */
.file-box:hover:not(:has(input.is-invalid)) .file-area {
    border-color: #3b82f6;
    background-color: #2564eb1a;
}


/* =======================================
   ANIMACIONES SUAVES
======================================= */
.field input,
.field select,
.field textarea,
.field-error {
    transition: all 0.3s ease;
}

.field textarea {
    color: var(--color-tipografia-description-form);
    height: 100px;
}


.field select option {
    background-color: var(--color-fondo-form);
}


/* ===== SECCIÓN AVANZADA DE ARCHIVOS PDF ===== */
.file-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-tipografia-description-form);
}

.file-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.file-card {
    flex: 1;
    min-width: 280px;
    padding: 1rem;
    border-radius: 12px;
    background-color: var(--color-fondo-form);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.file-box {
    position: relative;
    width: 100%;
}

.file-box input[type="file"] {
    opacity: 0;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
}

.file-area {
    border: 2px dashed var(--color-border-form-modal);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background-color: var(--color-fondo-form);
    transition: border-color 0.3s, background 0.3s;
}


.file-box:hover .file-area {
    border-color: #3b82f6;
    background-color: #2564eb1a;
}

.file-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.file-text {
    font-weight: 500;
    color: var(--color-tipografia-description-form);
}

.file-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

.file-preview-btn {
    padding: 0.8rem 1rem;
    width: 100%;
    border: none;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-base);
    transition: background 0.3s;
}

.file-preview-btn:hover {
    background: #2563eb;
}

.file-preview {
    width: 100%;
    min-height: 60px;
    border-radius: 6px;
    background-color: var(--color-subItem-active-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-tipografia-description-form);
    font-size: 0.9rem;
    padding: 0.5rem;
    word-break: break-all;
    text-align: center;
    border: solid 1px var(--color-border-form);
}


.form-witness-1 {
    display: none;
    background-color: var(--color-fondo-form);
    border: solid 1px var(--color-border-form);
    padding: 2%;
    border-radius: 10px;
}

.switch-wrapper .title {
    margin-left: 35px;
    color: var(--color-tipografia-description-form);
}

.form-witness-1 h3 {
    color: var(--color-tipografia-description-form);
}

.form-witness-2 {
    display: none;
    background-color: var(--color-fondo-form);
    border: solid 1px var(--color-border-form);
    padding: 2%;
    border-radius: 10px;
}

.form-witness-2 h3 {
    color: var(--color-tipografia-description-form);
}


/* ===============================
   MENSAJES DE VALIDACIÓN ABAJO
================================ */
.field .input-msg {
    order: -1;
    margin-top: 0.25rem;
    font-size: 0.8rem;
}










/* =======================================
   RESPONSIVE
======================================= */
@media (max-width: 768px) {
    .field-group {
        grid-template-columns: 1fr;
    }

    .form-footer-sticky {
        padding: 1rem;
    }
}





