/* ------------------------------------------------------------------
   NovaPay Gateway — thème clair professionnel
   ------------------------------------------------------------------ */

[x-cloak] { display: none !important; }

html { color-scheme: light; }

body {
    background:
        radial-gradient(1000px 520px at 8% -10%, var(--page-glow, rgba(37, 99, 235, .07)), transparent 62%),
        radial-gradient(820px 460px at 96% -6%, var(--page-glow2, rgba(14, 165, 233, .06)), transparent 58%),
        var(--page-bg, #f6f8fc);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Grille discrète en fond */
.bg-grid {
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, .045) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 72%);
}

/* Cartes : la base du système */
.card {
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 1rem;
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .04),
        0 14px 36px -26px rgba(16, 24, 40, .28);
}
.card-strong {
    background: #fff;
    border: 1px solid #e2e8f2;
    border-radius: 1rem;
    box-shadow:
        0 1px 2px rgba(16, 24, 40, .05),
        0 24px 50px -28px rgba(16, 24, 40, .30);
}

/* Liseré lumineux en haut des cartes */
.sheen { position: relative; overflow: hidden; }
.sheen::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .22), rgba(14, 165, 233, .16), transparent);
}

/* Champs de formulaire */
.field {
    width: 100%;
    border-radius: .75rem;
    border: 1px solid #dbe2ec;
    background: #fff;
    padding: .7rem .9rem;
    font-size: .875rem;
    color: #0f172a;
    outline: none;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field::placeholder { color: #9aa8bd; }
.field:hover { border-color: #c7d2e2; }
.field:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    background: #fff;
}
.field-error {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, .10) !important;
}
.label {
    display: block;
    margin-bottom: .4rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #64748b;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    caret-color: #0f172a;
    transition: background-color 9999s ease-in-out 0s;
}

/* Boutons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: .75rem;
    background: #2563eb;
    padding: .8rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 10px 24px -14px rgba(37, 99, 235, .55);
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-benepay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: .75rem;
    background: #0284c7;
    padding: .8rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 10px 24px -14px rgba(2, 132, 199, .55);
    transition: background .15s ease;
}
.btn-benepay:hover { background: #0369a1; }
.btn-benepay:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: .75rem;
    border: 1px solid #dbe2ec;
    background: #fff;
    padding: .8rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    color: #334155;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: background .15s ease, border-color .15s ease;
}
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

/* Carte bancaire (aperçu) */
.credit-card {
    position: relative;
    aspect-ratio: 1.586 / 1;
    border-radius: 1.25rem;
    padding: 1.4rem;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(37, 99, 235, .95), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(2, 132, 199, .7), transparent 55%),
        linear-gradient(135deg, #0b2a5b, #0b1220 78%);
    box-shadow: 0 24px 48px -24px rgba(15, 23, 42, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
    transition: background .5s ease;
}
.credit-card[data-brand="mastercard"] {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(234, 88, 12, .9), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(190, 24, 93, .55), transparent 55%),
        linear-gradient(135deg, #2b1206, #0b1220 78%);
}
.credit-card[data-brand="amex"] {
    background:
        radial-gradient(120% 120% at 0% 0%, rgba(5, 150, 105, .9), transparent 55%),
        radial-gradient(120% 120% at 100% 100%, rgba(2, 132, 199, .6), transparent 55%),
        linear-gradient(135deg, #04231c, #0b1220 78%);
}
.credit-card::after {
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 70%;
    height: 160%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, .16), transparent);
    transform: rotate(12deg);
    pointer-events: none;
}
.card-chip {
    width: 2.6rem;
    height: 1.9rem;
    border-radius: .45rem;
    background: linear-gradient(135deg, #fde68a, #d97706 55%, #fbbf24);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), inset 0 2px 3px rgba(255, 255, 255, .5);
    position: relative;
}
.card-chip::before,
.card-chip::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    height: 1px;
    background: rgba(120, 53, 15, .55);
}
.card-chip::before { top: 33%; }
.card-chip::after { top: 66%; }

.tabular { font-variant-numeric: tabular-nums; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .28); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .45); background-clip: content-box; }

/* Apparition douce */
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.rise-1 { animation-delay: .05s; }
.rise-2 { animation-delay: .12s; }
.rise-3 { animation-delay: .18s; }

/* Point "live" */
.live-dot {
    position: relative;
    display: inline-flex;
    height: .5rem;
    width: .5rem;
    border-radius: 999px;
    background: #10b981;
}
.live-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #10b981;
    animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping {
    75%, 100% { transform: scale(2.4); opacity: 0; }
}

/* Squelette */
@keyframes shimmer {
    100% { transform: translateX(100%); }
}
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, .06);
    border-radius: .5rem;
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
    animation: shimmer 1.6s infinite;
}

/* Barre de progression */
.progress { height: 6px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; }

@media print {
    header, footer, .no-print { display: none !important; }
    body { background: #fff; color: #0f172a; }
}

/* ------------------------------------------------------------------
   BenePay — mockups (téléphone, carte eID, lecteur)
   ------------------------------------------------------------------ */

.phone-frame {
    position: relative;
    border-radius: 2.6rem;
    padding: 10px;
    background: linear-gradient(160deg, #334155, #0f172a);
    border: 1px solid rgba(15, 23, 42, .2);
    box-shadow: 0 40px 80px -35px rgba(15, 23, 42, .55), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.phone-screen {
    position: relative;
    overflow: hidden;
    border-radius: 2rem;
    background: #fff;
}
.phone-notch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 78px;
    height: 16px;
    border-radius: 999px;
    background: #0f172a;
    z-index: 5;
}

.eid-reader {
    background: linear-gradient(180deg, #f8fafc, #eef3f9);
    border: 1px solid #dbe2ec;
    box-shadow: inset 0 1px 0 #fff;
}

.eid-card {
    background: linear-gradient(125deg, #0d2f66 0%, #1155a3 45%, #0a1a38 100%);
    box-shadow: 0 18px 30px -14px rgba(15, 23, 42, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.eid-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -60% auto;
    width: 70%;
    height: 120%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .14), transparent);
    transform: rotate(10deg);
}

.pin-key {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.4rem;
    border-radius: .6rem;
    border: 1px solid #dbe2ec;
    background: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .9rem;
    color: #1e293b;
    box-shadow: 0 1px 1px rgba(16, 24, 40, .04);
    transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.pin-key:hover { background: #f1f5f9; border-color: #c7d2e2; }
.pin-key:active { transform: scale(.95); }

.pin-dot {
    height: .7rem;
    width: .7rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    transition: background .15s ease, border-color .15s ease;
}
.pin-dot[data-filled="true"] {
    background: #0284c7;
    border-color: #0284c7;
    box-shadow: 0 0 12px rgba(2, 132, 199, .35);
}

@keyframes waiting-pulse {
    0%, 100% { opacity: .45; transform: scale(.92); }
    50% { opacity: 1; transform: scale(1.05); }
}
.waiting-pulse { animation: waiting-pulse 2s ease-in-out infinite; }

@keyframes card-in {
    0% { transform: translate(-50%, -160%) rotate(-14deg); opacity: 0; }
    60% { transform: translate(-50%, 0) rotate(-4deg); opacity: 1; }
    100% { transform: translate(-50%, 0) rotate(-4deg); opacity: 1; }
}
.card-in { animation: card-in .9s cubic-bezier(.2, .8, .2, 1) both; }

/* Halo BenePay (clair) */
.benepay-glow {
    background:
        radial-gradient(700px 380px at 80% 8%, rgba(14, 165, 233, .16), transparent 62%),
        radial-gradient(560px 300px at 5% 85%, rgba(37, 99, 235, .09), transparent 60%);
}

/* ------------------------------------------------------------------
   Thème par client (variables injectées par le layout)
   ------------------------------------------------------------------ */

.bg-brand { background-color: var(--brand); }
.bg-brand:hover { background-color: var(--brand-strong); }
.bg-brand-soft { background-color: var(--brand-soft); }
.text-brand { color: var(--brand); }
.text-brand-strong { color: var(--brand-strong); }
.border-brand { border-color: var(--brand); }
.ring-brand { --tw-ring-color: var(--brand-ring); }
.bg-brand-gradient { background-image: linear-gradient(135deg, var(--brand), var(--brand-strong)); }

.blink-red {
    color: #dc2626 !important;
    background: #fee2e2 !important;
    box-shadow: 0 0 0 1px #dc2626 inset;
    animation: blinkRed 1s steps(2, start) infinite;
}
@keyframes blinkRed {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.25; }
}
