/*
 * Confort Sales — overrides locaux (en plus de Tailwind CDN).
 * Design light, palette Confort (#7c3aed), Inter, soft shadows.
 */

/* ---------- Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    overscroll-behavior-y: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    background-attachment: fixed;
    color: #0f172a;
    font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: "cv11", "ss01", "ss03";
    letter-spacing: -0.01em;
    margin: 0;
}

/* x-cloak — masque l'app tant qu'Alpine n'est pas initialisée */
[x-cloak] { display: none !important; }

/* ---------- Scrollbars douces ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; border: 2px solid transparent; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.2s ease-out; }

/* ---------- Focus ring uniforme ---------- */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(124 58 237 / 0.18);
    border-color: #8b5cf6;
}

/* Désactive le user-select global hors inputs (UX PWA) */
button, a, h1, h2, h3, label, span, dt, dd, summary {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
input, textarea, code {
    -webkit-user-select: text;
    user-select: text;
}

/* ---------- Boutons ---------- */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-warning,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
    line-height: 1.2;
}
.btn-primary:active,
.btn-secondary:active,
.btn-success:active,
.btn-warning:active,
.btn-danger:active { transform: scale(0.97); }

.btn-primary[disabled],
.btn-secondary[disabled],
.btn-success[disabled],
.btn-warning[disabled],
.btn-danger[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 8px rgb(124 58 237 / 0.18);
}
.btn-primary:hover { background: #6d28d9; }

.btn-secondary {
    background: #fff;
    color: #334155;
    border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-success {
    background: #059669;
    color: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 8px rgb(5 150 105 / 0.18);
}
.btn-success:hover { background: #047857; }

.btn-warning {
    background: #ea580c;
    color: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 8px rgb(234 88 12 / 0.18);
}
.btn-warning:hover { background: #c2410c; }

.btn-danger {
    background: #e11d48;
    color: #fff;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 8px rgb(225 29 72 / 0.18);
}
.btn-danger:hover { background: #be123c; }

/* ---------- Cards ---------- */
.card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 2px 8px rgb(15 23 42 / 0.04);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 0.5rem;
    letter-spacing: 0.02em;
    line-height: 1.4;
    border: 1px solid transparent;
}
.badge-active   { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge-trial    { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.badge-expired  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge-revoked  { background: #e2e8f0; color: #475569; border-color: #cbd5e1; }
.badge-suspended{ background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ---------- Zone caméra ---------- */
#reader {
    min-height: 320px;
    background: #f1f5f9;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}
#reader video {
    width: 100% !important;
    height: auto !important;
    border-radius: 1rem;
    display: block;
}
#reader__dashboard_section_csr button,
#reader__dashboard_section_swaplink {
    color: #7c3aed !important;
    font-weight: 600 !important;
}

/* ---------- Safe areas iOS ---------- */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ---------- Mode standalone PWA ---------- */
@media all and (display-mode: standalone) {
    body { user-select: none; }
}
