/* =============================================
   formulario-empresas – form.css  v2
   ============================================= */

/* Ocultar hasta que cargue el CSS */
#fe-form-wrap {
    visibility: hidden;
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

#fe-form-wrap {
    max-width: 620px;
    margin: 0 auto;
    font-family: 'DM Sans', sans-serif;
}

/* ── Card contenedor ─────────────────────────── */
#fe-form-wrap form {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 40px;
    box-shadow: 0 4px 24px rgba(30, 80, 160, 0.10);
    border: 1px solid #e8edf5;
}

/* ── Título del card ─────────────────────────── */
#fe-form-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e50a0;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8edf5;
    display: flex;
    align-items: center;
    gap: 10px;
}

#fe-form-title svg {
    flex-shrink: 0;
}

/* ── Fila de 2 columnas ──────────────────────── */
.fe-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── Campo individual ────────────────────────── */
.fe-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.fe-field:last-of-type {
    margin-bottom: 0;
}

.fe-field label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a8aaa;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fe-field label svg {
    color: #1e50a0;
    flex-shrink: 0;
}

.fe-req {
    color: #e05252;
    margin-left: 1px;
    font-size: 0.85rem;
}

/* ── Input con wrapper para prefijo ─────────── */
.fe-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fe-input-prefix {
    position: absolute;
    left: 13px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e50a0;
    pointer-events: none;
    user-select: none;
}

.fe-field input[type="text"],
.fe-field input[type="number"] {
    padding: 11px 14px;
    border: 1.5px solid #dce4f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    color: #1a2540;
    background: #f7f9fc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.fe-field input[type="text"]:focus,
.fe-field input[type="number"]:focus {
    outline: none;
    border-color: #1e50a0;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(30, 80, 160, 0.12);
}

.fe-input-wrap input[type="number"] {
    padding-left: 28px;
}

/* ── Input file ──────────────────────────────── */
.fe-file-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1.5px dashed #b0c2e0;
    border-radius: 8px;
    background: #f7f9fc;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.fe-file-wrap:hover {
    border-color: #1e50a0;
    background: #eef3fb;
}

.fe-file-wrap input[type="file"] {
    display: none;
}

.fe-file-btn {
    background: #1e50a0;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.fe-file-btn:hover {
    background: #163d80;
}

.fe-file-name {
    font-size: 0.88rem;
    color: #7a8aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.fe-file-name.selected {
    color: #1e50a0;
    font-weight: 500;
}

/* ── Hint ────────────────────────────────────── */
.fe-hint {
    font-size: 0.75rem;
    color: #aab4c8;
    margin-top: 5px;
}

/* ── Radio buttons ───────────────────────────── */
.fe-radio-group {
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.fe-radio-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid #dce4f0;
    border-radius: 8px;
    background: #f7f9fc;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: #4a5a7a;
    transition: all 0.2s;
    user-select: none;
}

.fe-radio-label:hover {
    border-color: #1e50a0;
    background: #eef3fb;
    color: #1e50a0;
}

.fe-radio-label input[type="radio"] {
    display: none;
}

.fe-radio-label.active {
    border-color: #1e50a0;
    background: #1e50a0;
    color: #ffffff;
    font-weight: 600;
}

/* ── Divider ─────────────────────────────────── */
.fe-divider {
    border: none;
    border-top: 1.5px solid #e8edf5;
    margin: 24px 0;
}

/* ── Botón enviar ────────────────────────────── */
#fe-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #1e50a0;
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    margin-top: 28px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(30, 80, 160, 0.25);
}

#fe-submit:hover:not(:disabled) {
    background: #163d80;
    box-shadow: 0 6px 18px rgba(30, 80, 160, 0.35);
    transform: translateY(-1px);
}

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

#fe-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Mensajes ────────────────────────────────── */
#fe-message {
    display: none;
    padding: 14px 18px;
    border-radius: 9px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
}

#fe-message.fe-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #edfaf3;
    border: 1.5px solid #27ae60;
    color: #1a7a42;
}

#fe-message.fe-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fdf2f2;
    border: 1.5px solid #e05252;
    color: #a93226;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 520px) {
    #fe-form-wrap form {
        padding: 24px 20px;
    }
    .fe-row {
        grid-template-columns: 1fr;
    }
    .fe-radio-group {
        flex-direction: column;
    }
}

/* ── Botón: estado cargando ──────────────────── */

.fe-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.fe-btn-loader::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: fe-spin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── Modal overlay ───────────────────────────── */

#fe-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 50, 0.55);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#fe-modal-overlay.visible {
    display: flex;
    animation: fe-overlay-in 0.25s ease;
}

@keyframes fe-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal card ──────────────────────────────── */

#fe-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 44px 48px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(10, 20, 50, 0.25);
    animation: fe-modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fe-modal-in {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

#fe-modal-icon {
    margin-bottom: 16px;
}

#fe-modal-icon svg {
    filter: drop-shadow(0 4px 12px rgba(39, 174, 96, 0.35));
}

#fe-modal-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a2540;
    margin: 0 0 12px;
}

#fe-modal-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: #6b7a99;
    line-height: 1.6;
    margin: 0 0 28px;
}

#fe-modal-ok {
    display: inline-block;
    padding: 12px 40px;
    background: #1e50a0;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(30, 80, 160, 0.3);
}

#fe-modal-ok:hover {
    background: #163d80;
    box-shadow: 0 6px 18px rgba(30, 80, 160, 0.4);
    transform: translateY(-1px);
}

#fe-modal-ok:active {
    transform: translateY(0);
}

#fe-submit .fe-btn-loader[hidden] {
    display: none !important;
}

#fe-submit .fe-btn-text[hidden] {
    display: none !important;
}

/* Mostrar una vez cargado */
#fe-form-wrap.fe-ready {
    visibility: visible;
    animation: fe-fadein 0.3s ease;
}

@keyframes fe-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}