/* Mi Nemer — estilo wallet (referencia SariCuotas) */

.wallet-body {
    margin: 0;
    min-height: 100dvh;
    background: linear-gradient(180deg, #031a10 0%, #052e1a 40%, #0a3d24 100%);
    color: #ecfdf5;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.wallet-main {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.wallet-auth .wallet-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    padding-top: 32px;
    padding-bottom: 32px;
}

/* --- Auth --- */
.wallet-hero {
    text-align: center;
    margin-bottom: 28px;
}

.wallet-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(34, 197, 94, .35);
}

.wallet-hero h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: #fff;
}

.wallet-hero p {
    margin: 0;
    color: rgba(236, 253, 245, .72);
    font-size: 15px;
    line-height: 1.5;
}

.wallet-tabs {
    display: flex;
    background: rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.wallet-tabs a {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(236, 253, 245, .65);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.wallet-tabs a.activo {
    background: #fff;
    color: #052e1a;
}

.wallet-card {
    background: #fff;
    color: #0f172a;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

.wallet-card .campo { margin-bottom: 14px; }

.wallet-card label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wallet-card input {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
}

.wallet-card input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
    outline: none;
}

.wallet-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(34, 197, 94, .35);
}

.wallet-btn:hover { filter: brightness(1.05); }

.wallet-nota {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: rgba(236, 253, 245, .7);
}

.wallet-nota a {
    color: #4ade80;
    font-weight: 600;
    text-decoration: none;
}

.wallet-demo {
    margin-top: 20px;
    padding: 14px;
    background: rgba(255, 255, 255, .06);
    border-radius: 14px;
    font-size: 12px;
    color: rgba(236, 253, 245, .6);
}

.wallet-demo strong { color: #4ade80; }

.wallet-flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.wallet-flash.ok { background: rgba(34, 197, 94, .2); color: #bbf7d0; }
.wallet-flash.error { background: rgba(239, 68, 68, .2); color: #fecaca; }

/* --- App header --- */
.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    max-width: 480px;
    margin: 0 auto;
}

.wallet-marca {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.wallet-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.wallet-nav a {
    color: rgba(236, 253, 245, .75);
    text-decoration: none;
    font-weight: 500;
}

.wallet-logout { margin: 0; }

.wallet-logout button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    color: rgba(236, 253, 245, .8);
    border-radius: 8px;
    padding: 6px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

/* --- Panel --- */
.wallet-id-card {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 8px 28px rgba(34, 197, 94, .3);
}

.wallet-id-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .85;
    margin-bottom: 6px;
}

.wallet-id-code {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: .12em;
    font-variant-numeric: tabular-nums;
}

.wallet-id-nombre {
    margin-top: 10px;
    font-size: 14px;
    opacity: .9;
}

.wallet-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.wallet-stat {
    background: #fff;
    color: #0f172a;
    border-radius: 16px;
    padding: 16px;
}

.wallet-stat-valor {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.wallet-stat-valor.ok { color: #16a34a; }
.wallet-stat-valor.alerta { color: #dc2626; }

.wallet-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-top: 4px;
}

.wallet-banner {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: rgba(236, 253, 245, .85);
}

.wallet-banner a {
    color: #4ade80;
    font-weight: 600;
}

.wallet-seccion {
    margin-bottom: 24px;
}

.wallet-seccion-titulo {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(236, 253, 245, .55);
    margin: 0 0 12px 4px;
}

.wallet-linea {
    background: #fff;
    color: #0f172a;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}

.wallet-linea-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.wallet-linea h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
}

.wallet-linea-meta {
    font-size: 12px;
    color: #64748b;
}

.wallet-etiqueta {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.wallet-etiqueta.ok { background: #d1fae5; color: #047857; }
.wallet-etiqueta.pendiente { background: #dbeafe; color: #1d4ed8; }
.wallet-etiqueta.alerta { background: #fef3c7; color: #b45309; }
.wallet-etiqueta.error { background: #fee2e2; color: #b91c1c; }

.wallet-progreso {
    height: 6px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0;
}

.wallet-progreso span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 999px;
}

.wallet-monto-grande {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.03em;
    color: #0f172a;
}

.wallet-cuota-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.wallet-cuota-item:first-child { border-top: none; }

.wallet-btn-sm {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: #052e1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.wallet-aviso-item {
    background: rgba(255, 255, 255, .06);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 13px;
}

.wallet-aviso-item strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
}

.wallet-vacio {
    text-align: center;
    padding: 32px 16px;
    background: rgba(255, 255, 255, .06);
    border-radius: 16px;
    color: rgba(236, 253, 245, .7);
}

.wallet-vacio .wallet-btn-sm {
    margin-top: 14px;
    background: #22c55e;
}

details.wallet-details summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    list-style: none;
}

details.wallet-details summary::-webkit-details-marker { display: none; }

.wallet-form-inline {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.wallet-form-inline select,
.wallet-form-inline input {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font: inherit;
}

/* --- PWA: barra inferior + standalone --- */
.wallet-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    text-align: center;
    background: rgba(5, 46, 26, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.app-cliente .wallet-topbar-light {
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--borde);
    backdrop-filter: blur(12px);
}

.wallet-topbar-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.app-cliente .wallet-topbar-light .wallet-topbar-title {
    color: var(--texto);
}

.con-tabbar {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 8px max(8px, env(safe-area-inset-bottom));
    background: rgba(3, 26, 16, .96);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .2);
}

.app-cliente .tabbar {
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--borde);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, .08);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10px;
    font-weight: 600;
    color: rgba(236, 253, 245, .55);
    text-decoration: none;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
}

.app-cliente .tabbar-item {
    color: var(--texto-suave);
}

.tabbar-item.activa {
    color: #4ade80;
    background: rgba(255, 255, 255, .06);
}

.app-cliente .tabbar-item.activa {
    color: var(--primario);
    background: var(--primario-suave);
}

.tabbar-icon {
    font-size: 18px;
    line-height: 1;
}

.tabbar-form {
    margin: 0;
    border: none;
    background: transparent;
}

.tabbar-form button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 6px 4px;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 10px;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.pwa-install {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    color: #0f172a;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
}

.wallet-auth .pwa-install {
    bottom: max(16px, env(safe-area-inset-bottom));
}

.pwa-install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    color: #64748b;
}

.pwa-install-text strong {
    font-size: 14px;
    color: #0f172a;
}

.pwa-install-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-install-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: #16a34a;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pwa-install-dismiss {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

html.pwa-standalone .wallet-topbar,
html.pwa-standalone .tabbar {
    padding-top: env(safe-area-inset-top);
}

.app-cliente .barra,
.app-cliente .pie-sitio {
    display: none;
}

.app-cliente .contenido {
    max-width: 480px;
    padding-top: 0;
}

/* Inputs 16px+ evita zoom en iOS */
.wallet-card input,
.tabbar-item,
.form-solicitante input {
    font-size: 16px;
}

@media (min-width: 768px) {
    .tabbar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }

    .pwa-install {
        max-width: 456px;
        left: 50%;
        transform: translateX(-50%);
    }
}
