﻿/* ?? Reset / Base ???????????????????????????????????????????????????????????? */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.container { max-width: 1140px; }

/* ?? Navbar ??????????????????????????????????????????????????????????????????? */
.site-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand-custom {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.navbar-brand-custom:hover { color: #2563eb; }
.navbar-brand-custom i { color: #2563eb; font-size: 1.2rem; }

.nav-link-custom {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-link-custom:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.nav-link-highlight {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

.nav-link-highlight:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ?? Footer ??????????????????????????????????????????????????????????????????? */
.site-footer {
    margin-top: auto;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 1rem 0;
    font-size: 0.8125rem;
    color: #94a3b8;
    text-align: center;
}

/* ?? Loading overlay ?????????????????????????????????????????????????????????
   Oculto por defecto; visible al agregar la clase .loading-visible.
   z-index 1054: encima del navbar sticky (z-index 100) pero bajo modales
   Bootstrap (z-index 1055).
?????????????????????????????????????????????????????????????????????????????? */
#global-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 1054;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#global-loading-overlay.loading-visible {
    opacity: 1;
    pointer-events: all;
}

.loading-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    min-width: 200px;
}

.loading-card .spinner-border {
    width: 2.25rem;
    height: 2.25rem;
    border-width: 3px;
    color: #2563eb;
}

.loading-card .loading-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    margin: 0;
}


/* ?? Buttons – focus ring ????????????????????????????????????????????????????? */
.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* ?? Cards ???????????????????????????????????????????????????????????????????? */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* ?? Alerts / messages ???????????????????????????????????????????????????????? */
.alert { border-radius: 8px; font-size: 0.875rem; }

/* ?? Indicador de pasos del flujo de facturación ???????????????????????????? */
.step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.step-indicator {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.step-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    white-space: nowrap;
}

.step-indicator.active {
    background: #2563eb;
    color: #fff;
}

.step-indicator.done {
    background: #16a34a;
    color: #fff;
}

.step-wrapper.active .step-label  { color: #2563eb; font-weight: 700; }
.step-wrapper.done   .step-label  { color: #16a34a; }

.step-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    align-self: center;
    min-width: 20px;
    margin-bottom: 22px; /* compensa el espacio de la etiqueta */
}

.step-line.done {
    background: #16a34a;
}