/* ==========================================================
   Oneticket · page de liens
   Même direction artistique que noan-contact.oneticket.fr
   Couleurs : charte Oneticket (Purple 500 = #4F48E6)
   ========================================================== */

:root {
    /* Échelle Purple (Figma Brand, page Colors) */
    --p50: #f0f0fe;
    --p300: #a19df2;
    --p400: #756ef0;
    --p500: #4f48e6;
    --p600: #3e38c7;

    /* Fonds nuit (oneticket.fr) */
    --bg: #07071a;
    --bg2: #0d0c28;
    --bg3: #141245;

    --border: rgba(161, 157, 242, 0.16);
    --muted: rgba(255, 255, 255, 0.58);
    --text: #ffffff;

    --ft: 'Dela Gothic One', system-ui, sans-serif;
    --fb: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --ease: cubic-bezier(.16, 1, .3, 1);

    /* Arrondis : valeurs de repli (navigateurs sans squircle, ex. Safari) */
    --r-card: 32px;
    --r-lg: 16px;
    --r-md: 12px;

    --container: 468px;
}

/* Squircle (coins « super-ellipse », comme les icônes iOS) :
   appliqué quand le navigateur sait le faire, sinon coins arrondis classiques */
@supports (corner-shape: squircle) {
    :root {
        --r-card: 56px;
        --r-lg: 26px;
        --r-md: 18px;
    }
    .card, .link, .link-icon, .share-btn,
    .modal-card, .modal-close, .qr-frame, .modal-btn {
        corner-shape: squircle;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--fb);
    color: var(--text);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Fond dégradé : halo violet en haut, nuit au centre, reflet en bas.
   Calque fixe pour que le dégradé ne bouge pas au défilement (iPhone compris). */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 110% 60% at 50% -12%, rgba(79, 72, 230, 0.55) 0%, rgba(79, 72, 230, 0.12) 45%, transparent 70%),
        radial-gradient(ellipse 80% 45% at 85% 105%, rgba(117, 110, 240, 0.22) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 0% 70%, rgba(46, 42, 153, 0.25) 0%, transparent 70%),
        linear-gradient(180deg, var(--bg3) 0%, var(--bg2) 38%, var(--bg) 100%);
}

/* Grain par-dessus toute la page */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: .12; /* intensité du grain : monter ou baisser ce chiffre */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 220px 220px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--p400); outline-offset: 3px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Carte ---------- */
.page-shell {
    position: relative;
    z-index: 1;
    width: min(100%, var(--container));
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(32px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.card {
    position: relative;
    overflow: hidden;
    background: rgba(13, 12, 40, 0.72);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, .5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero { padding: 40px 28px 22px; text-align: center; }

.identity { display: flex; justify-content: center; }
.identity-copy { min-width: 0; }

.brand { margin: 0; line-height: 1; }
.logotype {
    display: block;
    width: clamp(180px, 56vw, 236px);
    height: auto;
    margin: 0 auto;
    color: var(--p50); /* logo sur fond sombre : Brand 50 */
}

.role {
    margin-top: 14px;
    color: var(--p300);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .2px;
}

.hero-copy {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.intro {
    margin: 0 auto;
    max-width: 360px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    text-wrap: balance;
}

/* ---------- Liens ---------- */
.section { padding: 0 24px 26px; }

.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }

.link {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
    -webkit-tap-highlight-color: transparent;
}
.link:hover, .link:focus-visible {
    background: rgba(79, 72, 230, 0.1);
    border-color: rgba(79, 72, 230, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(79, 72, 230, 0.14);
}
.link:active { transform: translateY(0); }

.link-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--p300);
    background: rgba(79, 72, 230, 0.16);
    transition: color .25s var(--ease), background .25s var(--ease);
}
.link:hover .link-icon, .link:focus-visible .link-icon { color: #fff; background: var(--p500); }

.link-icon svg, .link-tail svg, .share-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.link-icon svg.icon-logo { width: 24px; height: 24px; stroke-width: 0; }

.link-copy { min-width: 0; }
.link-label { display: block; margin-bottom: 2px; font-size: 15px; font-weight: 600; color: var(--text); }
.link-value { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.link-tail { color: rgba(255, 255, 255, 0.25); transition: color .2s, transform .25s var(--ease); }
.link:hover .link-tail { color: var(--p300); transform: translateX(2px); }

/* ---------- Pied de carte ---------- */
.signature {
    padding: 16px 14px 18px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    text-align: center;
}

/* ---------- Bouton de partage ---------- */
.share-btn {
    width: 100%;
    min-height: 52px;
    margin-top: 14px;
    border-radius: var(--r-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--p300);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    -webkit-tap-highlight-color: transparent;
    transition: background .25s var(--ease), color .25s, border-color .25s;
}
.share-btn svg { width: 18px; height: 18px; }
.share-btn:hover, .share-btn:focus-visible {
    color: #fff;
    background: rgba(79, 72, 230, 0.12);
    border-color: rgba(79, 72, 230, 0.5);
}

/* ---------- Fenêtre QR ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 7, 26, 0.8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.modal[hidden] { display: none; }
.modal.is-open { opacity: 1; }

.modal-card {
    position: relative;
    width: min(100%, 360px);
    padding: 32px 24px 24px;
    text-align: center;
    border-radius: var(--r-card);
    background: var(--bg2);
    border: 1px solid var(--border);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8), 0 0 40px rgba(79, 72, 230, 0.15);
    transform: scale(.96);
    transition: transform .35s var(--ease);
}
.modal.is-open .modal-card { transform: scale(1); }

.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    transition: background .2s, color .2s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.modal-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.modal-title { margin: 0 0 6px; font-family: var(--ft); font-weight: 400; font-size: 20px; color: #fff; }
.modal-subtitle { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.qr-frame {
    width: 220px;
    height: 220px;
    margin: 0 auto 24px;
    padding: 16px;
    border-radius: var(--r-lg);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.qr-frame svg, .qr-frame img { width: 100% !important; height: 100% !important; display: block; }

.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-btn {
    min-height: 50px;
    border-radius: var(--r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--p300);
    font-weight: 600;
    font-size: 14px;
    background: rgba(79, 72, 230, 0.12);
    border: 1px solid var(--border);
    transition: background .2s var(--ease), color .2s, border-color .2s;
}
.modal-btn[hidden] { display: none; }
.modal-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modal-btn:hover { background: rgba(79, 72, 230, 0.22); color: #fff; border-color: rgba(79, 72, 230, 0.45); }
.modal-btn.is-done { color: #fff; background: rgba(79, 72, 230, 0.3); }

/* ---------- Apparition à l'ouverture ---------- */
@media (prefers-reduced-motion: no-preference) {
    .card { animation: rise .7s var(--ease) both; }
    .link-list li { animation: rise .6s var(--ease) both; }
    .link-list li:nth-child(1) { animation-delay: .12s; }
    .link-list li:nth-child(2) { animation-delay: .19s; }
    .link-list li:nth-child(3) { animation-delay: .26s; }
    .link-list li:nth-child(4) { animation-delay: .33s; }
    .link-list li:nth-child(5) { animation-delay: .40s; }
    .share-btn { animation: rise .6s .3s var(--ease) both; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (max-width: 420px) {
    .hero { padding: 34px 20px 20px; }
    .section { padding: 0 18px 22px; }
}
