/* ==========================================================================
   CASA 21 BOLIVIA — DESIGN SYSTEM "PRECISION + WARMTH" v2.0
   Sistema visual maestro para la App Móvil y Portal Digital de Clientes
   ========================================================================== */

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

:root {
    /* ─── 1. PALETA CROMÁTICA CORPORATIVA ─── */
    --c21-blue:           #1A3A8F; /* Azul Institucional (Solidez y Confianza) */
    --c21-blue-hover:     #142f74;
    --c21-blue-soft:      #EFF6FF;
    --c21-blue-border:    #BFDBFE;

    --c21-blue-deep:      #0B1A3D; /* Azul Noche Premium (Superficie FinTech) */
    --c21-blue-deep-90:   rgba(11, 26, 61, 0.92);

    --c21-gold:           #FFB800; /* Oro Cálido (Tarjeta CL21, Puntos y Acentos) */
    --c21-gold-hover:     #E6A500;
    --c21-yellow-soft:    #FFFBEB;
    --c21-yellow-border:  #FEF3C7;
    --c21-gold-warm:      #FFD03B;

    --c21-green:          #059669; /* Verde Esmeralda (Éxito, Al Día, Puntualidad) */
    --c21-green-soft:     #ECFDF5;
    --c21-green-border:   #A7F3D0;

    --c21-red:            #DC2626; /* Rojo Alerta (Mora, Vencimientos, Atención) */
    --c21-red-soft:       #FEF2F2;
    --c21-red-border:     #FECACA;

    /* ─── 2. SUPERFICIES Y FONDOS LUMINOSOS ─── */
    --bg-app:             #F8FAFC; /* Fondo principal claro / Gris Hielo */
    --bg-surface:         #FFFFFF; /* Superficie pura de tarjetas */
    --bg-subtle:          #F1F5FA; /* Fondo secundario de agrupación */
    --bg-elevated:        #FFFFFF;

    /* ─── 3. JERARQUÍA TIPOGRÁFICA ─── */
    --font-main:          'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-primary:       #0F172A; /* Slate 900 */
    --text-secondary:     #475569; /* Slate 600 */
    --text-muted:         #94A3B8; /* Slate 400 */
    --text-white:         #FFFFFF;

    /* ─── 4. BORDES Y SEPARADORES ─── */
    --border-light:       #E2E8F0;
    --border-subtle:      #F1F5F9;
    --border-strong:      #CBD5E1;

    /* ─── 5. RADIOS DE CURVATURA (CURVED ERGONOMICS) ─── */
    --radius-xs:          6px;
    --radius-sm:          10px;
    --radius-md:          16px;
    --radius-lg:          22px;
    --radius-xl:          28px;
    --radius-pill:        9999px;

    /* ─── 6. ELEVACIONES Y SOMBRAS SUAVES (NO SUCIAS) ─── */
    --shadow-subtle:      0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
    --shadow-card:        0 4px 16px rgba(15, 26, 61, 0.05), 0 1px 3px rgba(15, 26, 61, 0.03);
    --shadow-float:       0 12px 32px rgba(15, 26, 61, 0.09), 0 2px 6px rgba(15, 26, 61, 0.04);
    --shadow-cta:         0 4px 16px rgba(255, 184, 0, 0.35);
    --shadow-blue-cta:    0 4px 16px rgba(26, 58, 143, 0.30);

    /* ─── 7. TRANSICIONES Y TIEMPOS ─── */
    --transition-fast:    0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth:  0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring:  0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ─── RESET Y ESTILOS BASE ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ─── CABECERA INSTITUCIONAL UNIFICADA (TOP APP BAR) ─── */
.c21-top-app-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    height: auto;
    transition: var(--transition-smooth);
}

.c21-brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.c21-brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.c21-brand-logo-img:active {
    transform: scale(0.97);
}

.c21-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.c21-icon-btn {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.c21-icon-btn:hover {
    background: var(--c21-blue-soft);
    border-color: var(--c21-blue-border);
    color: var(--c21-blue);
}

.c21-icon-btn:active {
    transform: scale(0.94);
}

.c21-badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: var(--radius-pill);
    background: var(--c21-red);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.35);
}

/* ─── BARRA DE NAVEGACIÓN INFERIOR (5 TABS NATIVOS ANDROID) ─── */
.c21-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 6px 8px;
    box-shadow: 0 -4px 20px rgba(15, 26, 61, 0.05);
}

.c21-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 4px 2px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.c21-nav-tab svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.c21-nav-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.c21-nav-tab.active {
    color: var(--c21-blue);
}

.c21-nav-tab.active svg {
    transform: translateY(-2px);
    stroke-width: 2.5;
    color: var(--c21-blue);
}

.c21-nav-tab.active .c21-nav-label {
    font-weight: 800;
    color: var(--c21-blue);
}

.c21-nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 16px;
    height: 3px;
    background: var(--c21-blue);
    border-radius: var(--radius-pill);
}

/* ─── BOTTOM SHEETS MODERNOS (DESLIZANTES DESDE ABAJO) ─── */
.c21-bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(11, 26, 61, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
}

.c21-bottom-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.c21-bottom-sheet-panel {
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    background: var(--bg-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -12px 40px rgba(11, 26, 61, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform var(--transition-spring);
    overflow: hidden;
}

.c21-bottom-sheet-backdrop.active .c21-bottom-sheet-panel {
    transform: translateY(0);
}

.c21-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    margin: 12px auto 6px;
    flex-shrink: 0;
}

.c21-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px 14px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.c21-sheet-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.c21-sheet-close {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.c21-sheet-close:active {
    background: var(--border-light);
}

.c21-sheet-body {
    padding: 18px 20px 30px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── CHIPS Y PÍLDORAS DE ACCIÓN RÁPIDA (HORIZONTAL SCROLL) ─── */
.c21-quick-actions-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 16px 14px;
    margin: 0 -16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.c21-quick-actions-strip::-webkit-scrollbar {
    display: none;
}

.c21-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.c21-action-chip:hover {
    border-color: var(--c21-blue-border);
    background: var(--c21-blue-soft);
    color: var(--c21-blue);
}

.c21-action-chip:active {
    transform: scale(0.96);
}

.c21-action-chip.featured {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-color: #FDE68A;
    color: #92400E;
}

/* ─── BOTONES PRIMARIOS Y SECUNDARIOS ─── */
.c21-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--c21-gold-warm) 0%, var(--c21-gold) 100%);
    color: var(--c21-blue-deep);
    border: none;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-cta);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.c21-btn-primary:active {
    transform: scale(0.97);
}

.c21-btn-blue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--c21-blue) 0%, var(--c21-blue-deep) 100%);
    color: #ffffff;
    border: none;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-blue-cta);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-decoration: none;
}

.c21-btn-blue:active {
    transform: scale(0.97);
}

/* ─── MICRO-ANIMACIONES Y ENTRADAS ─── */
@keyframes c21FadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.c21-animate-fade-up {
    animation: c21FadeInUp 0.35s ease forwards;
}

