/* =====================================================
   GonzurqSPA — CSS Global
   Variables, reset, tipografía, utilidades, componentes
   ===================================================== */

/* Google Fonts: Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* ─── Variables ─────────────────────────────────────── */
:root {
    /* Paleta principal */
    --primary:         #1A3A5C;
    --primary-dark:    #0D2236;
    --primary-light:   #2A5080;
    --primary-rgb:     26, 58, 92;

    /* Secundario — naranja construcción */
    --secondary:       #F07020;
    --secondary-dark:  #C85A10;
    --secondary-light: #F5924A;
    --secondary-rgb:   240, 112, 32;

    /* Acento */
    --accent:          #2D9CDB;
    --accent-dark:     #1A7AB5;

    /* Neutros */
    --white:           #FFFFFF;
    --light:           #F4F8FF;
    --light-2:         #EDF1F9;
    --border:          #DDE3EF;
    --text:            #1C2B3A;
    --text-muted:      #6B7C93;
    --text-light:      #A0AEC0;

    /* Status */
    --success:         #16A34A;
    --success-bg:      #DCFCE7;
    --warning:         #D97706;
    --warning-bg:      #FEF3C7;
    --danger:          #DC2626;
    --danger-bg:       #FEE2E2;
    --info:            #0284C7;
    --info-bg:         #E0F2FE;

    /* Sombras */
    --shadow-sm:  0 1px 3px rgba(var(--primary-rgb), 0.08);
    --shadow:     0 4px 12px rgba(var(--primary-rgb), 0.10);
    --shadow-md:  0 8px 24px rgba(var(--primary-rgb), 0.12);
    --shadow-lg:  0 20px 40px rgba(var(--primary-rgb), 0.16);
    --shadow-xl:  0 30px 60px rgba(var(--primary-rgb), 0.22);

    /* Bordes */
    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    /* Tipografía */
    --font:       'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size:  16px;
    --line-height: 1.65;

    /* Transiciones */
    --transition:      all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;

    /* Layout */
    --max-width: 1200px;
    --nav-height: 76px;
    --section-py: 90px;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: var(--font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: var(--line-height);
    overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

/* ─── Tipografía ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }

p { margin-bottom: 1rem; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--text); }
small  { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Layout ─────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 24px;
}

.container-sm  { max-width: 860px; }
.container-lg  { max-width: 1400px; }

.section { padding-block: var(--section-py); }
.section-sm { padding-block: 60px; }

/* Grid helpers */
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex helpers */
.flex       { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col   { flex-direction: column; }
.gap-1      { gap: 0.5rem; }
.gap-2      { gap: 1rem; }
.gap-3      { gap: 1.5rem; }
.gap-4      { gap: 2rem; }

/* ─── Colores de fondo / texto ───────────────────────── */
.bg-primary   { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-light     { background-color: var(--light); }
.bg-white     { background-color: var(--white); }
.text-primary   { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-white     { color: var(--white); }
.text-muted     { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ─── Botones ─────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary);
}
.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.7);
}
.btn-outline-white:hover {
    background: var(--white);
    color: var(--primary);
    border-color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
    padding-inline: 1rem;
}
.btn-ghost:hover {
    background: var(--light-2);
    color: var(--text);
}

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.82rem; }
.btn-lg { padding: 0.95rem 2.5rem; font-size: 1rem; }
.btn-icon { padding: 0.6rem; aspect-ratio: 1; justify-content: center; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* ─── Cards ──────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.card-body    { padding: 2rem; }
.card-header  { padding: 1.25rem 2rem; border-bottom: 1px solid var(--border); }
.card-footer  { padding: 1.25rem 2rem; border-top: 1px solid var(--border); background: var(--light); }

/* ─── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-success   { background: var(--success-bg);  color: var(--success); }
.badge-warning   { background: var(--warning-bg);  color: var(--warning); }
.badge-danger    { background: var(--danger-bg);   color: var(--danger); }
.badge-info      { background: var(--info-bg);     color: var(--info); }
.badge-secondary { background: var(--light-2);     color: var(--text-muted); }
.badge-primary   { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }

/* ─── Formularios ────────────────────────────────────── */
.form-group  { margin-bottom: 1.25rem; }
.form-label  {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.45rem;
}
.form-label.required::after {
    content: ' *';
    color: var(--danger);
}
.form-control {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7C93' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 0.3rem; display: none; }

.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ─── Sección encabezado ─────────────────────────────── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 1rem;
}
.section-label::before, .section-label::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary);
    border-radius: 2px;
}

.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--primary); margin-bottom: 1rem; }
.section-subtitle { font-size: 1.05rem; color: var(--text-muted); max-width: 580px; }
.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-header .section-subtitle { margin-inline: auto; }

/* ─── Flash messages ─────────────────────────────────── */
.flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    position: relative;
}
.flash i:first-child { font-size: 1.1rem; flex-shrink: 0; }
.flash span { flex: 1; }
.flash-close {
    background: none; border: none; cursor: pointer;
    opacity: 0.6; transition: var(--transition-fast);
    padding: 0.15rem; border-radius: 4px;
}
.flash-close:hover { opacity: 1; background: rgba(0,0,0,0.08); }
.flash-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.flash-error   { background: var(--danger-bg);  color: var(--danger);  border-left: 4px solid var(--danger); }
.flash-warning { background: var(--warning-bg); color: var(--warning); border-left: 4px solid var(--warning); }
.flash-info    { background: var(--info-bg);    color: var(--info);    border-left: 4px solid var(--info); }

/* ─── Utilidades ─────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: var(--radius-full); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

/* Margin / Padding shorthand */
.mt-1 { margin-top: 0.5rem; }  .mt-2 { margin-top: 1rem; }    .mt-3 { margin-top: 1.5rem; }  .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }.mb-4 { margin-bottom: 2rem; }
.pt-1 { padding-top: 0.5rem; } .pt-2 { padding-top: 1rem; }   .pt-3 { padding-top: 1.5rem; } .pt-4 { padding-top: 2rem; }
.pb-1 { padding-bottom: 0.5rem; }.pb-2 { padding-bottom: 1rem; }.pb-3 { padding-bottom: 1.5rem; }.pb-4 { padding-bottom: 2rem; }
.p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; } .p-4 { padding: 2rem; }

/* ─── Animaciones ────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes countUp {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-fade-up    { animation: fadeInUp 0.6s ease both; }
.animate-fade-in    { animation: fadeIn 0.5s ease both; }
.animate-slide-left { animation: slideInLeft 0.6s ease both; }
.animate-slide-right{ animation: slideInRight 0.6s ease both; }

/* Delay clases */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.65s ease, transform 0.65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Divisor decorativo ─────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-block: 1.5rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Spinner ────────────────────────────────────────── */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ─── Tabla responsive ───────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-lg); border: 1px solid var(--border); }

.table {
    width: 100%;
    font-size: 0.875rem;
}
.table th {
    padding: 0.875rem 1.25rem;
    background: var(--light);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--light); }
.table .actions { display: flex; gap: 0.4rem; }

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
    :root { --section-py: 70px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    :root { --section-py: 56px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .container { padding-inline: 16px; }
    .btn-lg { padding: 0.8rem 1.75rem; font-size: 0.9rem; }
}
@media (max-width: 480px) {
    :root { --section-py: 44px; }
}
