/* ==========================================================================
   JARVIS — Design system (mobile first)
   ========================================================================== */

:root {
    --brand: #1d4ed8;
    --brand-dark: #172554;
    --brand-soft: #e6edff;
    --accent: #06b6d4;
    --accent-soft: #e0f7fb;

    --bg: #f1f4fa;
    --card: #ffffff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e5e9f2;

    --ok: #15803d;
    --ok-soft: #e5f6ec;
    --warn: #b45309;
    --warn-soft: #fdf3e3;
    --danger: #b91c1c;
    --danger-soft: #fdecec;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 4px 18px rgba(15, 23, 42, .07);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);

    --nav-h: 68px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }

/* ---------- Structure ---------- */

.shell {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- En-tête ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(135deg, var(--brand) 0%, #2454d6 55%, var(--accent) 160%);
    color: #fff;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px;
    border-radius: 0 0 22px 22px;
    box-shadow: 0 6px 20px rgba(29, 78, 216, .22);
}

.topbar-inner {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    backdrop-filter: blur(4px);
}

.brand-logo svg { width: 22px; height: 22px; }

.brand-text { min-width: 0; }

.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.1;
}

.brand-sub {
    font-size: 12px;
    opacity: .82;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-spacer { flex: 1 1 auto; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease;
    flex: 0 0 auto;
}

.icon-btn:active { transform: scale(.94); background: rgba(255, 255, 255, .26); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Titres ---------- */

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 20px 0 4px;
}

.page-lead {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 18px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin: 22px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg { width: 18px; height: 18px; color: var(--brand); }

/* ---------- Cartes ---------- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid rgba(229, 233, 242, .9);
}

.card-tight { padding: 14px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.card-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 2px 0 0;
}

/* Cartes cliquables : effet d'appui */
.tap { transition: transform .12s ease, box-shadow .15s ease; }
.tap:active { transform: scale(.97); }

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .12s ease, opacity .15s ease;
    text-align: center;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn-outline {
    background: #fff;
    color: var(--brand);
    border-color: #c9d7f8;
}

.btn-ghost {
    background: var(--brand-soft);
    color: var(--brand);
}

.btn-danger { background: var(--danger); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { padding: 10px 14px; font-size: 14px; width: auto; }
.btn-block { width: 100%; }

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-row > .btn { flex: 1 1 160px; }

/* ---------- Formulaires ---------- */

.field { margin-bottom: 14px; }

.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input, .select, .textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: #fbfcff;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
    background: #fff;
}

.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--brand-soft);
    color: var(--brand);
    white-space: nowrap;
}

.badge svg { width: 13px; height: 13px; }
.badge-demo { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: #eef1f7; color: var(--muted); }

/* ---------- Assistant / conversation ---------- */

.chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0 8px;
}

.bubble {
    max-width: 88%;
    padding: 13px 15px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bubble.user {
    align-self: flex-end;
    background: var(--brand);
    color: #fff;
    border-bottom-right-radius: 6px;
}

.bubble.bot {
    align-self: flex-start;
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow);
}

.bubble.bot .bubble-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.bubble.bot .bubble-head svg { width: 14px; height: 14px; }

.bubble-attach { margin-top: 12px; }

.typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    opacity: .5;
    animation: blink 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
    0%, 100% { opacity: .3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

/* Suggestions */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chip {
    padding: 9px 13px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #d8e0f2;
    font-size: 13px;
    color: #1e3a8a;
    cursor: pointer;
    transition: transform .12s ease;
}

.chip:active { transform: scale(.96); }

/* Barre de saisie */

.composer {
    position: sticky;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    z-index: 30;
    padding: 10px 0 6px;
    background: linear-gradient(to top, var(--bg) 70%, rgba(241, 244, 250, 0));
}

/* ---------- Conversation mains libres ---------- */

.conv-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.conv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #c9d7f8;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, background .15s ease, color .15s ease;
}

.conv-btn:active { transform: scale(.97); }

.conv-btn.on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.conv-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
    opacity: .5;
    flex: 0 0 auto;
}

.conv-btn.on .conv-dot {
    opacity: 1;
    animation: pulse 1.4s infinite;
}

.conv-hint {
    font-size: 12.5px;
    color: var(--muted);
}

.composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 8px 8px 8px 14px;
    box-shadow: var(--shadow);
}

.composer textarea {
    flex: 1 1 auto;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
    max-height: 110px;
    padding: 8px 0;
    background: transparent;
    color: var(--ink);
}

.composer-send {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: none;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .12s ease;
}

.composer-send:active { transform: scale(.92); }
.composer-send svg { width: 20px; height: 20px; }
.composer-send.listening { background: var(--danger); animation: pulse 1.1s infinite; }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .45); }
    50% { box-shadow: 0 0 0 10px rgba(185, 28, 28, 0); }
}

/* ---------- Listes ---------- */

.list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .9);
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: transform .12s ease;
}

.list-item:active { transform: scale(.985); }

.avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar.accent { background: var(--accent-soft); color: #0e7490; }

.list-body { min-width: 0; flex: 1 1 auto; }

.list-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.list-name {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-time { font-size: 12px; color: var(--muted); flex: 0 0 auto; }

.list-subject {
    font-size: 14px;
    font-weight: 600;
    margin: 3px 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-snippet {
    font-size: 13px;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.unread-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 6px;
}

/* ---------- Statistiques ---------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(229, 233, 242, .9);
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    margin-top: 4px;
}

.stat-unit { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------- Météo ---------- */

.weather-hero {
    background: linear-gradient(140deg, var(--brand) 0%, #2b5ce0 55%, var(--accent) 150%);
    color: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 14px;
}

.weather-hero .wh-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.weather-hero .wh-city { font-size: 19px; font-weight: 700; }
.weather-hero .wh-country { font-size: 13px; opacity: .85; }

.weather-hero .wh-temp {
    font-size: 58px;
    font-weight: 700;
    line-height: 1;
    margin: 14px 0 4px;
}

.weather-hero .wh-desc { font-size: 15px; opacity: .95; }

.weather-hero .wh-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.weather-hero .wh-pill {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    backdrop-filter: blur(4px);
}

.weather-icon { width: 64px; height: 64px; flex: 0 0 auto; opacity: .95; }

.forecast {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.forecast-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .9);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.forecast-row .fr-day { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.forecast-row .fr-desc { font-size: 12px; color: var(--muted); }
.forecast-row .fr-temp { font-weight: 700; font-size: 15px; white-space: nowrap; }
.forecast-row .fr-icon { width: 30px; height: 30px; flex: 0 0 auto; color: var(--brand); }

/* ---------- Résultats voyages ---------- */

.result-row {
    background: #fff;
    border: 1px solid rgba(229, 233, 242, .9);
    border-radius: var(--radius-sm);
    padding: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 10px;
}

.result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.result-brand { font-weight: 700; font-size: 15px; }
.result-code { font-size: 12px; color: var(--muted); font-weight: 600; }

.result-times {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-time { font-size: 20px; font-weight: 700; }
.result-place { font-size: 12px; color: var(--muted); }

.result-arrow {
    flex: 1 1 auto;
    min-width: 46px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: 2px;
    position: relative;
}

.result-arrow::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.result-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.result-duration { font-size: 13px; color: var(--muted); }
.result-price { font-size: 19px; font-weight: 700; color: var(--brand); }

/* ---------- États vides / notes ---------- */

.empty {
    text-align: center;
    padding: 34px 18px;
    color: var(--muted);
}

.empty svg { width: 42px; height: 42px; color: #b8c4da; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 14px; }

.note {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    background: var(--warn-soft);
    color: #8a5200;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 12px;
}

.note svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.note.info { background: var(--accent-soft); color: #0e7490; }
.note.ok { background: var(--ok-soft); color: var(--ok); }

.skeleton {
    background: linear-gradient(90deg, #eef1f7 25%, #e3e8f2 50%, #eef1f7 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius-sm);
    height: 74px;
    margin-bottom: 10px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Navigation basse ---------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(229, 233, 242, .9);
}

.nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    border-radius: 14px;
    color: #7c8aa5;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .12s ease, background .18s ease, color .18s ease;
}

.nav-item:active { transform: scale(.94); }
.nav-item svg { width: 21px; height: 21px; }

.nav-item.active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, .28);
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(18px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item { position: relative; }

/* ---------- Modal ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}

.modal-card {
    background: #fff;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    animation: slideUp .22s ease;
}

@keyframes slideUp {
    from { transform: translateY(24px); opacity: .6; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.modal-title { font-size: 17px; font-weight: 700; margin: 0; }

/* ---------- Toast ---------- */

.toast-wrap {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    padding: 0 16px;
}

.toast {
    max-width: 520px;
    width: 100%;
    background: #0f172a;
    color: #fff;
    border-radius: 14px;
    padding: 13px 16px;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn .2s ease;
}

.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.info { background: #164e63; }

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

/* ---------- Écran de connexion ---------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 20px calc(30px + env(safe-area-inset-bottom));
}

.auth-logo {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: linear-gradient(140deg, var(--brand), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 12px 28px rgba(29, 78, 216, .28);
}

.auth-logo svg { width: 40px; height: 40px; color: #fff; }

.auth-title {
    text-align: center;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .1em;
    margin: 0;
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 6px 0 24px;
}

.switcher {
    display: flex;
    gap: 6px;
    background: #e8ecf5;
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 20px;
}

.switcher button {
    flex: 1 1 0;
    padding: 10px 8px;
    border: none;
    border-radius: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.switcher button.active {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

/* ---------- Écran d'ouverture ---------- */

#app-splash {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

#app-splash.show {
    display: flex;
    animation: splashOut .4s ease 1.2s forwards;
}

#app-splash img { width: 96px; height: 96px; border-radius: 22px; }
#app-splash span { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: .14em; }

@keyframes splashOut {
    to { opacity: 0; visibility: hidden; }
}

/* ---------- Bloc installation ---------- */

.install-card {
    background: linear-gradient(140deg, #0f172a, #1e3a8a);
    color: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 14px;
}

.install-card h3 { margin: 0 0 4px; font-size: 16px; }
.install-card p { margin: 0 0 14px; font-size: 13px; opacity: .85; line-height: 1.5; }

.install-stores {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
    opacity: .9;
}

.install-stores svg { width: 26px; height: 26px; }

.btn-install {
    background: #fff;
    color: #0f172a;
    font-weight: 700;
}

/* ---------- Interrupteurs (réglages) ---------- */

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.switch-row:last-of-type { border-bottom: none; }

.sw-label { font-size: 14px; font-weight: 600; }
.sw-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.switch {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 28px;
    display: inline-block;
}

.switch input {
    position: absolute;
    opacity: 0;
    width: 48px;
    height: 28px;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.switch .track {
    position: absolute;
    inset: 0;
    background: #cfd8e8;
    border-radius: 999px;
    transition: background .18s ease;
}

.switch .track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
    transition: transform .18s ease;
}

.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(29, 78, 216, .2); }

/* ---------- Divers ---------- */

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }

.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }

/* ---------- Reveal au scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s ease, transform .45s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ==========================================================================
   RESPONSIVE — on part du mobile, on enrichit au-delà de 768px
   ========================================================================== */

@media (min-width: 768px) {
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .forecast { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .bubble { max-width: 76%; }
    .modal-card { border-radius: 22px; margin: auto; }
    .modal { align-items: center; }
}

@media (max-width: 767px) {
    /* Toute grille multi-colonnes repasse sur une seule colonne */
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .forecast { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .btn-row { flex-direction: column; }
    .btn-row > .btn { flex: 1 1 auto; width: 100%; }
    .result-times { flex-wrap: wrap; }
    .weather-hero .wh-top { flex-direction: row; }
}

@media (max-width: 380px) {
    .weather-hero .wh-temp { font-size: 48px; }
    .stat-value { font-size: 22px; }
    .nav-item { font-size: 10px; }
}
