/* css/spm.css — Styles pour la vitrine “Horloge des Marées Connectée” */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-heading: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color-scheme: dark;

    /* “Bleu nuit” — version allégée : panneaux plus discrets, plus d’air */
    --panel-bg: rgba(255,255,255,0.035);
    --panel-bd: rgba(255,255,255,0.10);
    --panel-shadow: 0 10px 26px rgba(0,0,0,0.28);
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 0 100%, #0d578a 0, #071320 55%, #020710 100%);
    color: #f5f7fb;
    font-family: var(--font-body);
}

h1, h2, h3 { font-family: var(--font-heading); }

.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;
}

a { color: #5ad7ff; text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.8rem 1.2rem 3rem;
}

/* Header / branding */
header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
header .brand-main { flex: 1 1 auto; }
header h1 {
    margin: 0 0 .3rem 0;
    font-size: 1.9rem;
    font-weight: 500;
    letter-spacing: .03em;
}
header p { margin: 0; opacity: 0.9; }
header .brand-logo img {
    height: 48px;
    width: auto;
    opacity: 0.9;
}

/* Navigation principale */
.main-nav {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
}
.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 40px;
    padding: .25rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.06);
    color: #e5ecff;
    text-decoration: none;
}
.main-nav a:hover { background: rgba(255,255,255,0.09); text-decoration: none; }
.main-nav a[aria-current="page"] {
    border-color: rgba(90,215,255,0.8);
    box-shadow: 0 0 0 3px rgba(90,215,255,0.15);
}
.main-nav a.nav-ico { width: 40px; padding: 0; }

/* Layout */
main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* Cards */
.card {
    background: var(--panel-bg);
    border-radius: 18px;
    padding: 1.25rem 1.45rem 1.35rem;
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--panel-bd);
    backdrop-filter: blur(8px);
}
.card h2 {
    margin: 0 0 1.1rem 0;
    font-size: 1.15rem;
    font-weight: 500;
    position: relative;
}
.card h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -.55rem;
    width: 56px;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0));
    opacity: 0.55;
}
.card p { margin: 0 0 .85rem 0; font-size: .92rem; line-height: 1.5; }

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    margin-top: .3rem;
}
th, td { padding: .45rem .5rem; text-align: left; }
th {
    font-weight: 600;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
tr:nth-child(even) td { background: rgba(255,255,255,0.012); }

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.3);
    background: linear-gradient(90deg, #1d87ff, #16c2ff);
    color: #061322;
    cursor: pointer;
    margin-right: .2rem;
    white-space: nowrap;
}
.btn-icon { display: inline-block; margin-right: .35rem; font-size: .95em; }
.btn.is-icon { padding: .35rem .55rem; min-width: 42px; min-height: 36px; }
.btn.is-icon .btn-icon { margin-right: 0; font-size: 1.05em; }
.btn:hover { filter: brightness(1.05); }

/* Actions : flex + wrap */
.ports-table-actions {
    white-space: normal;
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
    flex-wrap: wrap;
}

/* =========================
   HORLOGE — “hors cadre”
   ========================= */
.card.card-clock {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.card-clock { display: flex; align-items: center; justify-content: center; }

.card-clock .dial-wrapper {
    position: relative;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* halo objet */
.card-clock .dial-wrapper::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        rgba(255,255,255,0.10) 0%,
        rgba(255,255,255,0.05) 35%,
        rgba(0,0,0,0) 70%);
    z-index: 0;
}

/* Cadran */
.card-clock .dial-face {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(0,0,0,0.55);
    position: relative;
    z-index: 1;
}

/* Aiguille */
.card-clock .dial-hand {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 40%;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(0,0,0,0.7);
    transform-origin: 50% 85%;
    transform: translate(-50%, -85%) rotate(0deg);
    z-index: 3;
    transition: transform 0.55s cubic-bezier(.22,.61,.36,1);
}

/* Centre */
.card-clock .dial-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(0,0,0,0.7);
    transform: translate(-50%, -50%);
    z-index: 4;
}

/* Fenêtre coefficient */
.card-clock .dial-coef {
    position: absolute;
    top: 50%;
    right: 20%;
    transform: translate(50%, -50%);
    min-width: 40px;
    height: 22px;
    padding: 0 .28rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: linear-gradient(180deg, #ffffff, #f0f0f0);
    color: #222;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 8px rgba(0,0,0,0.30);
    border: 1px solid rgba(0,0,0,0.15);
    z-index: 10;
}

/* =========================
   Cockpit (démo)
   ========================= */
.sim-card { margin-top: 1.6rem; }
.sim-form {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    margin-bottom: .8rem;
}
.sim-form label { font-size: .85rem; opacity: .9; }
.sim-form select {
    min-width: 220px;
    background: #020b17;
    color: #f5f7fb;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    padding: .28rem .8rem;
    font-size: .86rem;
}
.sim-form .btn { margin-left: .2rem; }

.sim-result,
.sim-error {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .6rem .9rem;
    border-radius: 999px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .87rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.45);
}
.sim-result::before,
.sim-error::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.25);
}
.sim-result {
    background: linear-gradient(90deg, rgba(8, 160, 220, 0.35), rgba(0, 255, 210, 0.12));
    border: 1px solid rgba(90,215,255,0.95);
}
.sim-result::before { background: #5cf4ff; }
.sim-error {
    background: rgba(120, 0, 0, 0.55);
    border: 1px solid rgba(255, 80, 80, 0.9);
}
.sim-error::before { background: #ff6060; }

.sim-meta { margin-top: .45rem; font-size: .78rem; opacity: .82; }

/* Badge port */
.header-homeport {
    padding: .25rem .65rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.22);
    font-size: .78rem;
    opacity: .9;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
}
.header-homeport-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5cf4ff;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.35);
}

/* Galerie thèmes */
.theme-gallery { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.theme-swatch {
    flex: 0 0 160px;
    border-radius: 14px;
    padding: .6rem .7rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
    backdrop-filter: blur(8px);
    cursor: pointer;
    user-select: none;
}
.theme-swatch-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.45rem; font-size:.8rem; font-weight:500; }
.theme-swatch-pill { padding:.12rem .5rem; border-radius:999px; font-size:.7rem; background:rgba(0,0,0,0.4); border:1px solid rgba(255,255,255,0.35); }
.theme-swatch-preview { border-radius:10px; height:60px; position:relative; overflow:hidden; }
.theme-swatch-preview::before, .theme-swatch-preview::after { content:""; position:absolute; inset:0; }
.theme-swatch-default .theme-swatch-preview::before { background: radial-gradient(circle at 0 100%, #0d578a 0, #071320 55%, #020710 100%); }
.theme-swatch-default .theme-swatch-preview::after { background: radial-gradient(circle at 30% 0, rgba(94,191,255,0.45), transparent 62%); }
.theme-swatch-cezembre_vert .theme-swatch-preview::before { background: radial-gradient(circle at 0 100%, #00d5b5 0, #00b0b8 40%, #007f98 100%); }
.theme-swatch-cezembre_vert .theme-swatch-preview::after { background: radial-gradient(circle at 100% 0, rgba(255,255,255,0.30), transparent 63%); }
.theme-swatch-footer { margin-top:.35rem; font-size:.72rem; opacity:.8; }

.theme-radio {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.theme-radio:focus + .theme-swatch { box-shadow: 0 0 0 3px rgba(90,215,255,0.20), 0 10px 22px rgba(0,0,0,0.45); border-color: rgba(90,215,255,0.55); }
.theme-radio:checked + .theme-swatch { border-color: rgba(90,215,255,0.85); box-shadow: 0 0 0 3px rgba(90,215,255,0.18), 0 10px 22px rgba(0,0,0,0.45); }

/* Galerie cadrans */
.dial-gallery { display:flex; flex-wrap:wrap; gap:.75rem; margin-top:.15rem; }
.dial-radio {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.dial-swatch {
    flex: 0 0 220px;
    border-radius: 14px;
    padding: .6rem .7rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 18px rgba(0,0,0,0.22);
    backdrop-filter: blur(8px);
    cursor: pointer;
    user-select: none;
}
.dial-swatch-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.45rem; font-size:.8rem; font-weight:500; }
.dial-swatch-pill { padding:.12rem .5rem; border-radius:999px; font-size:.7rem; background:rgba(0,0,0,0.4); border:1px solid rgba(255,255,255,0.35); }
.dial-swatch-preview { border-radius:10px; height:130px; overflow:hidden; background:rgba(0,0,0,0.20); border:1px solid rgba(255,255,255,0.10); }
.dial-swatch-preview img { width:100%; height:100%; display:block; object-fit:cover; }
.dial-swatch-footer { margin-top:.35rem; font-size:.72rem; opacity:.8; }
.dial-radio:focus + .dial-swatch { box-shadow: 0 0 0 3px rgba(90,215,255,0.20), 0 10px 22px rgba(0,0,0,0.45); border-color: rgba(90,215,255,0.55); }
.dial-radio:checked + .dial-swatch { border-color: rgba(90,215,255,0.85); box-shadow: 0 0 0 3px rgba(90,215,255,0.18), 0 10px 22px rgba(0,0,0,0.45); }

/* Footer */
footer { margin-top: 1.6rem; font-size: .78rem; opacity: .85; }
footer a { color: inherit; text-decoration: underline; }

/* =======================================================
   RESPONSIVE — adaptation PC / tablette / smartphone
   ======================================================= */

@media (max-width: 900px) {
    .page { padding: 1.4rem 1rem 2.4rem; }
    main { grid-template-columns: minmax(0, 1fr); }
}

/* Smartphone */
@media (max-width: 640px) {
    body { overflow-x: hidden; } /* empêche le halo de créer un scroll horizontal */
    .page { padding: 1.05rem .9rem 2rem; max-width: 100%; }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: .85rem;
    }
    header .brand-logo img { height: 34px; }
    header h1 { font-size: 1.45rem; line-height: 1.25; }
    header p { font-size: .9rem; line-height: 1.35; }

    .main-nav { width: 100%; gap: .45rem; }
    .main-nav a { height: 38px; }
    .main-nav a.nav-ico { width: 38px; }

    .card {
        padding: 1.0rem 1.05rem 1.05rem;
        border-radius: 14px;
        box-shadow: 0 10px 22px rgba(0,0,0,0.30);
    }
    .card h2 { font-size: 1.02rem; }

    /* Horloge : largeur écran, sans débordement */
    .card-clock .dial-wrapper {
        max-width: min(420px, 92vw);
        width: 100%;
    }
    /* halo réduit sur mobile (et donc moins de risques de débordement) */
    .card-clock .dial-wrapper::before {
        width: 108%;
        height: 108%;
    }

    /* boutons : tap targets confort */
    .btn { font-size: .8rem; padding: .32rem .72rem; }
    .btn.is-icon { min-width: 44px; min-height: 40px; }

    footer { margin-top: 1.25rem; line-height: 1.45; }
}


/* --- GPS / Carte (Leaflet) ------------------------------------------------ */
.gps-box{margin-top:.4rem; padding:.55rem .7rem; border:1px solid rgba(120,220,255,.35); border-radius:999px; background:rgba(0,160,210,.12);}
.gps-row{display:flex; gap:.6rem; align-items:center; flex-wrap:wrap;}
.gps-dot{width:.55rem; height:.55rem; border-radius:50%; background:rgba(120,220,255,.95); box-shadow:0 0 0 4px rgba(120,220,255,.12);}
.gps-dec{font-variant-numeric:tabular-nums; letter-spacing:.02em;}
.gps-dms{opacity:.9; font-variant-numeric:tabular-nums;}
.ports-map{margin-top:.6rem; border-radius:18px; overflow:hidden; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04);}
.ports-map .leaflet-control-zoom a{border-radius:10px;}
