/* ====== Variables y Reset ====== */
.flc-wrap {
    --gap: 24px;
    --radius: 14px;
    --muted: #6b7280;
    --muted-light: #9ca3af;
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #e0f2fe;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--gap);
    align-items: start;
    margin: 10px auto;
    max-width: 1100px;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    line-height: 1.5;
    position: relative;
}

/* ====== Ficha Sticky ====== */
.flc-card:last-child {
    position: sticky;
    top: 20px;
    align-self: start;
    transition: var(--transition);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Scroll suave para la ficha en caso de contenido muy largo */
.flc-card:last-child::-webkit-scrollbar {
    width: 6px;
}

.flc-card:last-child::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.flc-card:last-child::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.flc-card:last-child::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ====== Responsive Layout ====== */
@media (max-width: 960px) {
    .flc-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* En móvil quitamos el sticky */
    .flc-card:last-child {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

@media (max-width: 768px) {
    .flc-wrap {
        --gap: 16px;
        margin: 5px auto;
    }
}

/* ====== Cards ====== */
.flc-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.flc-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.flc-card__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.flc-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.025em;
}

/* ====== Form Styles ====== */
.flc-form {
    padding: 24px;
}

.flc-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flc-grid > .full {
    grid-column: 1 / -1;
}

.flc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flc-field.two-col {
    grid-column: 1 / -1;
}

.flc-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

.flc-label::after {
    content: "*";
    color: var(--danger);
    font-size: 1.2em;
}

.flc-label:has(+ .flc-input:not([required]))::after,
.flc-label:has(+ .flc-select:not([required]))::after {
    content: "";
}

/* ====== Input Fields ====== */
.flc-input,
.flc-select,
.flc-file {
    appearance: none;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.flc-input:focus,
.flc-select:focus,
.flc-file:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.flc-input:hover,
.flc-select:hover,
.flc-file:hover {
    border-color: var(--muted-light);
}

.flc-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* ====== Buttons ====== */
.flc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px solid transparent;
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-height: 44px;
}

.flc-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.flc-btn--ghost {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.flc-btn--ghost:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.flc-btn--danger {
    background: var(--danger);
}

.flc-btn--danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ====== Dynamic Rows ====== */
.flc-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.dyn-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.dyn-row:hover {
    background: #f8fafc;
    border-color: var(--primary-light);
}

.dyn-row .flc-input,
.dyn-row .flc-select {
    flex: 1;
    margin: 0;
}

.dyn-row .remove {
    border: none;
    background: var(--danger);
    color: white;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.dyn-row .remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* ====== File Upload ====== */
.flc-file {
    padding: 10px;
    border-style: dashed;
    background: #fafafa;
    cursor: pointer;
}

.flc-file:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

#foto-preview {
    max-width: 150px;
    border-radius: 12px;
    margin-top: 12px;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

#foto-preview:hover {
    transform: scale(1.05);
}

.flc-help {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

/* ====== Ficha (Live Preview) ====== */
.flc-ficha {
    padding: 24px;
}

.ficha-top {
    display: flex;
    gap: 20px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.ficha-photo {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.ficha-photo:hover {
    transform: scale(1.05);
}

.ficha-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
}

.ficha-sub {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.ficha-section {
    margin-top: 20px;
}

.ficha-section h4 {
    margin: 0 0 12px;
    font-size: 0.75rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.pill {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    transition: var(--transition);
}

.pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ficha-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.ficha-list li {
    padding: 4px 0;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ficha-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
}

.ficha-muted {
    color: var(--muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ====== Loading States ====== */
.flc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.flc-btn--loading {
    position: relative;
    color: transparent;
}

.flc-btn--loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== Success States ====== */
.flc-field.success .flc-input,
.flc-field.success .flc-select {
    border-color: var(--success);
}

.flc-field.error .flc-input,
.flc-field.error .flc-select {
    border-color: var(--danger);
}

/* ====== Elementor Compatibility ====== */
.elementor-kit-7555 button,
.elementor-kit-7555 input[type="button"],
.elementor-kit-7555 input[type="submit"],
.elementor-kit-7555 .elementor-button {
    background-color: var(--primary);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    padding: 12px 20px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
}

.elementor-kit-7555 button:hover,
.elementor-kit-7555 input[type="button"]:hover,
.elementor-kit-7555 input[type="submit"]:hover,
.elementor-kit-7555 .elementor-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* ====== Mobile Optimizations ====== */
@media (max-width: 480px) {
    .flc-form,
    .flc-ficha {
        padding: 16px;
    }
    
    .flc-card__header {
        padding: 16px 20px;
    }
    
    .ficha-top {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .dyn-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .dyn-row .remove {
        align-self: flex-end;
    }
    
    .flc-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====== Print Styles ====== */
@media print {
    .flc-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .flc-btn,
    .flc-actions {
        display: none;
    }
    
    .flc-card:last-child {
        position: static;
    }
}
.elementor-kit-7555 h3 {
    text-transform: none;
}

/* Overlay + spinner */
.flc-loader-overlay{
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  z-index: 99999;
}
.flc-loader-box{
  background:#111827; color:#fff; padding:18px 20px; border-radius:14px;
  display:flex; align-items:center; gap:12px; box-shadow:0 10px 30px rgba(0,0,0,.3);
  font: 600 14px/1.2 Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
}
.flc-spinner{
  width:22px; height:22px; border:3px solid rgba(255,255,255,.25);
  border-top-color:#22d3ee; border-radius:50%; animation: flc-spin 1s linear infinite;
}
@keyframes flc-spin{ to{ transform: rotate(360deg);} }

/* Estado bloqueado del form */
.flc-loading{
  pointer-events:none;
  opacity:.6;
}
.flc-btn[disabled]{ opacity:.6; cursor:not-allowed; }

/* ===============================
   ESTILOS DIRECTORIO AGC
   =============================== */

.flc-dir-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #374151;
    line-height: 1.6;
}

/* ===== BUSCADOR ===== */
.flc-dir-filters {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flc-search-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.flc-search-header h2 {
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.flc-search-header p {
    color: #6b7280;
    font-size: 1rem;
    margin: 0;
}

.flc-search-grid {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 1rem;
    align-items: end;
}

.flc-search-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flc-search-main {
    grid-column: 1 / 2;
}

.flc-search-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.flc-search-group svg {
    opacity: 0.7;
}

.flc-search-group input {
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.flc-search-group input:focus {
    outline: none;
    border-color: #00659C;
    box-shadow: 0 0 0 3px rgba(0, 101, 156, 0.1);
}

.flc-search-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.flc-search-btn,
.flc-clear-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.flc-search-btn {
    background: #00659C;
    color: white;
}

.flc-search-btn:hover {
    background: #004d7a;
    transform: translateY(-1px);
}

.flc-clear-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.flc-clear-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* ===== RESUMEN ===== */
.flc-dir-wrap > div:not(.flc-dir-filters):not(.flc-dir-grid):not(.flc-dir-pager) {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #00659C;
    font-size: 0.875rem;
}

/* ===== GRID DE TARJETAS ===== */
.flc-dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.flc-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.flc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #cbd5e1;
}

/* ===== IMAGEN DE LA TARJETA ===== */
/* ===== SOLUCIÓN INTELIGENTE ===== */
.flc-card-image {
    position: relative;
    height: 335px;
    overflow: hidden;
    background: #f1f5f9;
}

/* Enfoque predeterminado para rostros */
.flc-member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 0.3s ease;
}

/* Para la imagen por defecto */
.flc-member-photo.no-photo {
    object-position: center center;
    object-fit: contain; /* Muestra toda la imagen sin recortar */
    background: #e2e8f0;
}

/* Clase específica para enfoque en rostro */
.flc-member-photo.face-focused {
    object-position: center 25%;
}

/* Si tienes control sobre las imágenes subidas, usa estas clases */
.flc-member-photo.portrait {
    object-position: center 20%;
}

.flc-member-photo.group-photo {
    object-position: center center;
}

.flc-member-photo.document {
    object-fit: contain;
    background: #f8fafc;
}

/* ===== CONTENIDO DE LA TARJETA ===== */
.flc-card-content {
    padding: 1.5rem;
}

.flc-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.flc-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.flc-gender,
.flc-member-since {
    color: #6b7280;
    display: flex;
    align-items: center;
}

.flc-gender::before {
    content: "•";
    margin-right: 0.5rem;
    color: #9ca3af;
}

.flc-member-since::before {
    content: "•";
    margin-right: 0.5rem;
    color: #9ca3af;
}

.flc-gender:first-child::before,
.flc-member-since:first-child::before {
    display: none;
}

/* ===== ETIQUETAS DE ESPECIALIDAD ===== */
.flc-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flc-tag {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #dbeafe;
}

/* ===== DETALLES DE CONTACTO ===== */
.flc-card-detail {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.flc-card-detail:last-child {
    margin-bottom: 0;
}

.flc-card-detail svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: #6b7280;
    opacity: 0.8;
}

.flc-card-detail span {
    color: #4b5563;
    line-height: 1.5;
}

.flc-card-detail a {
    color: #00659C;
    text-decoration: none;
    transition: color 0.2s ease;
}

.flc-card-detail a:hover {
    color: #004d7a;
    text-decoration: underline;
}

/* ===== SIN RESULTADOS ===== */
.flc-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #f8fafc;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    color: #6b7280;
}

.flc-no-results svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.flc-no-results h3 {
    color: #374151;
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.flc-no-results p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* ===== PAGINACIÓN ===== */
.flc-dir-pager {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.flc-dir-pager a {
    padding: 0.6rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.flc-dir-pager a:not([style*="background:#00659C"]) {
    background: #ffffff;
    color: #374151;
}

.flc-dir-pager a:not([style*="background:#00659C"]):hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.flc-dir-pager a[style*="background:#00659C"] {
    background: #00659C !important;
    color: #ffffff !important;
    border-color: #00659C !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .flc-dir-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .flc-search-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .flc-search-main {
        grid-column: 1;
    }
    
    .flc-search-actions {
        justify-content: stretch;
    }
    
    .flc-search-btn,
    .flc-clear-btn {
        flex: 1;
        justify-content: center;
    }
    
    .flc-dir-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .flc-dir-filters {
        padding: 1.5rem;
    }
    
    .flc-search-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .flc-dir-wrap {
        margin: 1rem auto;
    }
    
    .flc-card-content {
        padding: 1.25rem;
    }
    
    .flc-card-title {
        font-size: 1.125rem;
    }
    
    .flc-dir-filters {
        padding: 1.25rem;
        border-radius: 8px;
    }
}

/* ===== ESTADOS DE CARGA Y MEJORAS ===== */
.flc-card {
    animation: fadeInUp 0.5s ease;
}

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

/* Mejora para el placeholder de las imágenes */
.flc-member-photo {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* Estados de enfoque para accesibilidad */
.flc-search-btn:focus,
.flc-clear-btn:focus,
.flc-search-group input:focus,
.flc-dir-pager a:focus {
    outline: 2px solid #00659C;
    outline-offset: 2px;
}
/* Modale del buscador del directorio */

  /* Overlay pantalla completa */
  .flc-search-overlay{
    position: fixed; inset: 0; z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 10, 20, .75);
    backdrop-filter: blur(2px);
  }
  .flc-search-box{
    display: flex; gap: 12px; align-items: center;
    background: #0b1220; color:#fff; padding:16px 18px;
    border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
    font: 600 14px/1.2 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  .flc-search-spinner{
    width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.25);
    border-top-color:#22d3ee; border-radius:50%;
    animation: flcspin 1s linear infinite;
  }
  @keyframes flcspin { to { transform: rotate(360deg);} }

  /* Estado bloqueado de la UI mientras busca (opcional) */
  .flc-dir-wrap.flc-busy{ opacity:.6; pointer-events:none; }
  .flc-search-btn[disabled]{ opacity:.7; cursor:not-allowed; }


