/* ============================================
   EVM - Styles publics
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --theme-header: linear-gradient(135deg, #1e3c72 0%, #2b4e7a 100%);
    --theme-page: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --theme-accent: #ff9800;
    --color-text: #0f172a;
    --color-muted: #64748b;
    --color-bg: #f8fafc;
    --color-white: #ffffff;
    --color-border: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.18);
}

html, body { height: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--theme-page);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }

/* ============================================
   PAGE CARTE PAR SLUG : entête et pied masqués
   La carte client s'affiche en plein écran (URL /c/{slug}).
   La page d'accueil garde toujours son menu visible.
   ============================================ */
body.card-only .topnav,
body.card-only .site-footer {
    display: none !important;
}
body.card-only .main-wrapper {
    min-height: 100vh;
    padding: 20px;
}

/* ============================================
   TOPNAV
   ============================================ */
.topnav {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.topnav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--color-text);
}
.topnav-logo img { width: 36px; height: 36px; object-fit: contain; }
.topnav-logo span { font-size: 0.95rem; }

.topnav-links { display: flex; gap: 4px; align-items: center; }
.topnav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--color-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.topnav-links a:hover { background: #f1f5f9; color: var(--color-text); }
.topnav-links a.active { background: var(--theme-header); color: #fff; }
.topnav-admin {
    background: var(--theme-accent);
    color: #fff !important;
    margin-left: 8px;
}
.topnav-admin:hover { filter: brightness(1.1); background: var(--theme-accent) !important; color: #fff !important; }

.topnav-burger {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
}
.topnav-burger span {
    width: 24px;
    height: 3px;
    background: var(--color-text);
    border-radius: 2px;
    transition: 0.3s;
}

.topnav-mobile {
    display: none;
    flex-direction: column;
    background: #fff;
    padding: 10px 20px;
    border-top: 1px solid var(--color-border);
}
.topnav-mobile a {
    padding: 12px 0;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    font-weight: 500;
}
.topnav-mobile a:last-child { border-bottom: none; }
.topnav-mobile.open { display: flex; }

@media (max-width: 768px) {
    .topnav-links { display: none; }
    .topnav-burger { display: flex; }
}

/* ============================================
   MAIN WRAPPER
   ============================================ */
.main-wrapper {
    flex: 1;
    width: 100%;
    padding: 30px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

body.page-card .main-wrapper { align-items: center; }

/* ============================================
   VCARD
   ============================================ */
.card-container {
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.vcard {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.vcard-header {
    background: var(--theme-header);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.vcard-logo {
    background: #fff;
    border-radius: 14px;
    padding: 10px 18px;
    min-width: 100px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.vcard-logo img { max-height: 44px; max-width: 120px; object-fit: contain; }
.vcard-logo .logo-text {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--color-text);
}

.vcard-qr {
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    width: 96px;
    height: 96px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.vcard-qr img { width: 100%; height: 100%; }

.vcard-identity {
    text-align: center;
    padding: 24px 24px 8px;
}
.vcard-identity h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 6px;
}
.vcard-company {
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
    margin-bottom: 4px;
}
.vcard-slogan {
    font-style: italic;
    color: var(--color-muted);
    font-size: 0.95rem;
}

.vcard-body { padding: 16px 24px 20px; }

.vcard-presentation {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 0.92rem;
    color: var(--color-muted);
    line-height: 1.55;
}

.vcard-contacts {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.vcard-contacts li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
    border-radius: 8px;
}
.vcard-contacts li:last-child { border-bottom: none; }
.vcard-contacts li:hover { background: #f8fafc; padding-left: 8px; }
.vcard-contacts .ico {
    width: 36px;
    height: 36px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.vcard-contacts a {
    color: var(--color-text);
    font-size: 0.92rem;
    word-break: break-word;
    flex: 1;
}
.vcard-contacts a:hover { color: var(--theme-accent); }

.vcard-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--color-border);
    background: #f8fafc;
}

.qr-hint {
    text-align: center;
    margin-bottom: 14px;
    padding: 12px;
    background: #fff;
    border-radius: var(--radius-sm);
}
.qr-hint strong { display: block; color: var(--color-text); font-size: 0.9rem; }
.qr-hint small { color: var(--color-muted); font-size: 0.8rem; }

.vcard-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-action {
    flex: 1;
    min-width: 100px;
    padding: 11px 12px;
    background: var(--theme-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    transition: all 0.2s;
}
.btn-action:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 8px 16px rgba(0,0,0,0.15); }

@media (max-width: 480px) {
    .vcard-header { padding: 18px; }
    .vcard-logo { min-width: 80px; height: 56px; padding: 8px 14px; }
    .vcard-qr { width: 80px; height: 80px; }
    .vcard-identity h1 { font-size: 1.3rem; }
    .vcard-identity { padding: 18px 18px 4px; }
    .vcard-body, .vcard-footer { padding-left: 18px; padding-right: 18px; }
}

/* ============================================
   PAGE PRÉSENTATION
   ============================================ */
.presentation {
    width: 100%;
    max-width: 1100px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.presentation-hero {
    text-align: center;
    padding: 50px 30px;
    background: var(--theme-header);
    color: #fff;
}
.presentation-hero img { width: 90px; height: 90px; margin: 0 auto 18px; object-fit: contain; }
.presentation-hero h1 { font-size: 2.2rem; margin-bottom: 14px; font-weight: 700; }
.presentation-hero .lead { font-size: 1.05rem; opacity: 0.95; max-width: 700px; margin: 0 auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
    background: var(--theme-accent);
    color: #fff;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-block;
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: var(--shadow-md); }
.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
    display: inline-block;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.3); }

.features, .templates, .benefits { padding: 50px 30px; }
.features h2, .templates h2, .benefits h2 {
    text-align: center;
    font-size: 1.7rem;
    margin-bottom: 30px;
    color: var(--color-text);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.feature-card {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--color-border);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--color-text); }
.feature-card p { font-size: 0.88rem; color: var(--color-muted); }

.templates { background: #f8fafc; }
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.template-preview {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
}
.template-preview:hover { transform: scale(1.03); }
.tp-preview {
    height: 140px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tp-circle { width: 50px; height: 50px; background: rgba(255, 255, 255, 0.85); border-radius: 50%; }
.tp-line { width: 60%; height: 8px; background: rgba(255, 255, 255, 0.7); border-radius: 4px; }
.tp-line.short { width: 40%; height: 6px; }
.template-preview h4 { font-size: 1rem; margin-bottom: 4px; }
.template-preview p { font-size: 0.82rem; color: var(--color-muted); }

.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.benefit {
    background: #f8fafc;
    border-left: 4px solid var(--theme-accent);
    padding: 16px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.benefit strong { color: var(--color-text); font-size: 0.95rem; }
.benefit span { color: var(--color-muted); font-size: 0.85rem; }

@media (max-width: 600px) {
    .presentation-hero { padding: 35px 20px; }
    .presentation-hero h1 { font-size: 1.6rem; }
    .features, .templates, .benefits { padding: 35px 20px; }
}

/* ============================================
   ABONNEMENTS
   ============================================ */
.subscriptions {
    width: 100%;
    max-width: 1100px;
    background: #fff;
    border-radius: var(--radius);
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
}
.subs-header { text-align: center; margin-bottom: 36px; }
.subs-header h1 { font-size: 2rem; margin-bottom: 10px; color: var(--color-text); }
.subs-header .lead { color: var(--color-muted); font-size: 1rem; }

.subs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.sub-card {
    background: #fff;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 22px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.sub-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

.sub-card.sub-popular {
    border-color: var(--theme-accent);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.2);
    transform: scale(1.02);
}
.sub-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--theme-accent);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.sub-card h3 { font-size: 1.4rem; margin-bottom: 6px; color: var(--color-text); }
.sub-desc { color: var(--color-muted); font-size: 0.88rem; margin-bottom: 20px; min-height: 40px; }

.sub-price { margin: 18px 0 22px; padding: 14px 0; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.price-amount { font-size: 2.2rem; font-weight: 700; color: var(--color-text); }
.price-currency { font-size: 0.95rem; font-weight: 600; color: var(--color-muted); margin-left: 4px; }
.price-period { display: block; font-size: 0.85rem; color: var(--color-muted); margin-top: 2px; }

.sub-features { list-style: none; text-align: left; margin-bottom: 22px; flex: 1; }
.sub-features li {
    padding: 8px 0;
    color: var(--color-text);
    font-size: 0.88rem;
    border-bottom: 1px dashed var(--color-border);
}
.sub-features li:last-child { border-bottom: none; }

.btn-subscribe {
    width: 100%;
    padding: 13px;
    background: var(--theme-header);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s;
}
.sub-popular .btn-subscribe {
    background: var(--theme-accent);
}
.btn-subscribe:hover { transform: translateY(-2px); filter: brightness(1.1); box-shadow: var(--shadow-md); }

.payment-info {
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 26px 22px;
    margin-top: 30px;
}
.payment-info h3 { font-size: 1.2rem; margin-bottom: 16px; color: var(--color-text); text-align: center; }
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.pm-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    border: 2px solid var(--theme-accent);
}
.pm-name { font-weight: 700; color: var(--theme-accent); font-size: 1.05rem; margin-bottom: 4px; }
.pm-number { font-size: 1.3rem; font-weight: 700; color: var(--color-text); letter-spacing: 1px; }
.payment-note { font-size: 0.85rem; color: var(--color-muted); text-align: center; margin-top: 8px; }

@media (max-width: 600px) {
    .subscriptions { padding: 30px 18px; }
    .subs-header h1 { font-size: 1.5rem; }
    .sub-card.sub-popular { transform: none; }
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    background: #fff;
    border-radius: var(--radius);
    padding: 50px 30px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-md);
}
.empty-state img { width: 70px; height: 70px; margin: 0 auto 16px; object-fit: contain; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--color-muted); margin-bottom: 18px; }

/* ============================================
   MODALES
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s;
    padding: 20px;
}
.modal-overlay.show { opacity: 1; }
.modal-overlay[hidden] { display: none; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    max-width: 460px;
    width: 100%;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 22px 24px;
    color: #fff;
    text-align: center;
    position: relative;
}
.modal-header img { width: 48px; height: 48px; margin: 0 auto 10px; object-fit: contain; }
.modal-header h3 { font-size: 1.2rem; }

.modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.35); }

.modal-body { padding: 26px 24px; text-align: center; }
.modal-body p { color: var(--color-muted); font-size: 0.95rem; margin-bottom: 8px; }
.modal-body h2 { color: var(--color-text); margin: 6px 0; }
.mb-company { color: var(--color-text) !important; font-weight: 600; margin-bottom: 14px !important; }
.install-hint {
    background: #fff7ed;
    border-radius: var(--radius-sm);
    padding: 12px;
    color: #9a3412 !important;
    font-size: 0.88rem !important;
    margin-top: 14px;
    border-left: 3px solid var(--theme-accent);
}

.modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.modal-footer button, .modal-footer a {
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.modal-footer .btn-primary { background: var(--theme-accent); color: #fff; }
.modal-footer .btn-secondary { background: #e2e8f0; color: var(--color-text); border: none; }
.modal-footer button:hover, .modal-footer a:hover { transform: translateY(-1px); filter: brightness(1.05); }

.share-body { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.share-qr { background: #fff; padding: 10px; border-radius: var(--radius-sm); border: 2px solid var(--color-border); }
.share-qr img { width: 200px; height: 200px; }
.share-instr { font-size: 0.9rem; color: var(--color-muted); }
.share-link { display: flex; gap: 8px; width: 100%; }
.share-link input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: #f8fafc;
}
.share-link button {
    padding: 10px 18px;
    background: var(--theme-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.sub-summary {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
    text-align: left;
}
.sub-summary p { color: var(--color-text); margin-bottom: 6px; }
.sub-payment { text-align: left; }
.sub-payment h4 { margin-bottom: 10px; color: var(--color-text); }
.sub-payment ol { padding-left: 20px; color: var(--color-muted); font-size: 0.9rem; line-height: 1.7; }

/* ============================================
   MODALE INSTALLATION (instructions par OS/navigateur)
   ============================================ */
.install-modal { max-width: 500px; }
.install-modal .modal-header { position: relative; padding: 28px 24px 22px; }
.install-modal .install-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 1;
}
.install-modal .install-title {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
}
.install-body { text-align: left !important; padding: 24px !important; }
.install-intro {
    color: var(--color-muted) !important;
    font-size: 0.92rem !important;
    margin-bottom: 18px !important;
    text-align: left !important;
}
.install-steps {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
    margin: 0;
}
.install-steps li {
    counter-increment: step-counter;
    position: relative;
    padding: 14px 14px 14px 56px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--theme-accent);
    color: var(--color-text);
    font-size: 0.92rem;
    line-height: 1.5;
}
.install-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: var(--theme-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}
.install-steps li b {
    color: var(--color-text);
    font-weight: 700;
    background: #fff7ed;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text);
    color: #fff;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    z-index: 2000;
    transition: transform 0.3s;
    opacity: 0;
    pointer-events: none;
    max-width: 90%;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.toast-success { background: #10b981; }
.toast.toast-error { background: #ef4444; }
.toast.toast-info { background: #3b82f6; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    padding: 16px 20px;
    font-size: 0.85rem;
}
