/* Studiworld : identité propre (bleu nuit, sarcelle, safran) – propriétés logiques pour l'arabe (RTL) */
:root {
  --ink: #0f1b2d; --ink-2: #3d4a5c; --muted: #6b7686;
  --teal: #0b6e69; --teal-2: #0f8a83; --teal-soft: #e3f2f0;
  --sun: #f2a007; --sun-soft: #fff4dc;
  --sand: #f6f3ee; --line: #e3ded5; --white: #fff;
  --red: #c2410c; --green: #15803d;
  --r: 14px; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 8px 24px rgba(15,27,45,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Geeza Pro", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--sand); }
a { color: var(--teal); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.sw-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.ti-svg { width: 1.15em; height: 1.15em; vertical-align: -.2em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Logo */
.sw-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.sw-logo-mark { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 200deg, var(--teal) 0 55%, var(--sun) 55% 75%, var(--teal-2) 75%); position: relative; flex: none; }
.sw-logo-mark::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--sand); box-shadow: inset 0 0 0 2px var(--ink); }
.sw-logo b { color: var(--teal); font-weight: 800; }

/* En-tête */
.sw-head { background: rgba(246,243,238,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.sw-head .sw-wrap { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.sw-head nav { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sw-lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--white); }
.sw-lang button { border: 0; background: none; font: inherit; font-size: .78rem; padding: 4px 9px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.sw-lang button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
@media (max-width: 640px) {
  .sw-head .sw-wrap { flex-wrap: wrap; padding-block: 10px; }
  .sw-head nav { width: 100%; margin: 0; justify-content: space-between; }
  .sw-lang button { padding: 4px 7px; }
}

/* Boutons */
.sw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; border-radius: 10px; padding: 11px 18px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s; }
.sw-btn:active { transform: translateY(1px); }
.sw-btn-primary { background: var(--teal); color: var(--white); }
.sw-btn-primary:hover { background: var(--teal-2); }
.sw-btn-sun { background: var(--sun); color: var(--ink); }
.sw-btn-ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.sw-btn-sm { padding: 7px 12px; font-size: .88rem; }
.sw-btn[disabled] { opacity: .55; cursor: wait; }
.sw-link { background: none; border: 0; font: inherit; color: var(--teal); text-decoration: underline; cursor: pointer; padding: 0; }

/* Cartes, formulaires */
.sw-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.sw-field { display: grid; gap: 6px; margin-bottom: 14px; }
.sw-field label, .sw-label { font-weight: 600; font-size: .92rem; }
.sw-field small, .sw-hint { color: var(--muted); font-size: .82rem; }
input, select, textarea { font: inherit; height: 44px; color: var(--ink); width: 100%; padding: 10px 12px; border: 1px solid #cfc8bc; border-radius: 10px; background: var(--white); min-height: 44px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid rgba(11,110,105,.25); outline-offset: 1px; border-color: var(--teal); }
textarea { height: auto; }
input[type=checkbox] { width: auto; height: auto; min-height: 0; accent-color: var(--teal); }
.sw-check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 4px 0 14px; }
.sw-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .sw-grid2 { grid-template-columns: 1fr; } }
.sw-msg { padding: 10px 14px; border-radius: 10px; font-size: .92rem; margin: 0 0 14px; }
.sw-msg-ok { background: var(--teal-soft); color: #064e4a; }
.sw-msg-err { background: #fdecea; color: #8a1c0b; }
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer; font-size: .9rem; user-select: none; }
.sw-chip input { margin: 0; }
.sw-chip:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); color: #064e4a; font-weight: 600; }

/* Accueil */
.sw-hero { padding: clamp(40px, 8vw, 96px) 0 40px; }
.sw-kicker { display: inline-block; background: var(--sun-soft); color: #8a5a00; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; margin-bottom: 18px; }
[dir=rtl] .sw-kicker { letter-spacing: 0; }
.sw-hero h1 { max-width: 18ch; }
.sw-hero p.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.sw-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.sw-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 56px; }
.sw-feat .sw-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); margin-bottom: 12px; font-size: 1.2rem; }
.sw-feat:nth-child(2) .sw-ic { background: var(--sun-soft); color: #8a5a00; }
@media (max-width: 820px) { .sw-feats { grid-template-columns: 1fr; } }
.sw-band { background: var(--ink); color: var(--white); border-radius: var(--r); padding: 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 56px; }
.sw-band p { color: #c7d0dc; margin: 0; }
.sw-foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: .85rem; }

/* Connexion */
.sw-auth { min-height: calc(100vh - 64px); display: grid; place-items: start center; padding: 40px 16px 60px; }
.sw-auth .sw-card { width: 100%; max-width: 480px; }
.sw-tabs { display: flex; gap: 4px; background: var(--sand); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.sw-tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--ink-2); display: inline-flex; gap: 6px; justify-content: center; align-items: center; }
.sw-tabs button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.sw-auth-links { display: grid; gap: 8px; margin-top: 16px; font-size: .9rem; text-align: center; }
.sw-free { text-align: center; color: var(--muted); font-size: .85rem; margin: 14px 0 0; }

/* Espace */
.sw-space { padding: 28px 0 60px; }
.sw-space-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.sw-space-head h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0; }
.sw-progress { min-width: 260px; flex: 1; max-width: 420px; }
.sw-progress-top { display: flex; justify-content: space-between; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.sw-bar { height: 10px; background: #e7e1d6; border-radius: 999px; overflow: hidden; }
.sw-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-2)); border-radius: inherit; transition: width .4s; }
.sw-bar.full > i { background: linear-gradient(90deg, var(--teal), var(--sun)); }
.sw-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.sw-nav button { border: 0; background: none; font: inherit; font-weight: 600; padding: 10px 14px; cursor: pointer; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.sw-nav button[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.sw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .sw-layout { grid-template-columns: 1fr; } .sw-aside { order: -1; } }
.sw-sec { margin-bottom: 18px; }
.sw-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.sw-sec h2 .sw-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.sw-equiv { font-size: .88rem; color: var(--teal); font-weight: 600; min-height: 1.3em; }
.sw-test-row { display: grid; grid-template-columns: 1.4fr .8fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 10px; }
@media (max-width: 560px) { .sw-test-row { grid-template-columns: 1fr 1fr; } .sw-test-row .sw-field { margin: 0; } }
.sw-save { position: sticky; bottom: 0; z-index: 5; background: var(--sand); border-top: 1px solid var(--line); padding: 12px 0; display: flex; gap: 12px; align-items: center; }
.sw-save .sw-msg { margin: 0; }
.sw-aside .sw-card { margin-bottom: 14px; }
.sw-empty { text-align: center; color: var(--ink-2); padding: 34px 22px; }
.sw-empty .sw-ic { font-size: 2rem; color: var(--teal); }
.sw-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sw-table th, .sw-table td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sw-table th { font-size: .78rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.sw-scroll { overflow-x: auto; }
.sw-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--sand); }
.sw-pill.ok { background: #dcfce7; color: var(--green); }
.sw-pill.warn { background: var(--sun-soft); color: #8a5a00; }
.sw-mini-bar { display: inline-block; width: 70px; height: 6px; background: #e7e1d6; border-radius: 9px; overflow: hidden; vertical-align: middle; margin-inline-end: 6px; }
.sw-mini-bar i { display: block; height: 100%; background: var(--teal); }
.sw-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sw-kpi b { display: block; font-size: 1.6rem; }
.sw-kpi span { color: var(--muted); font-size: .85rem; }
@media (max-width: 700px) { .sw-kpis { grid-template-columns: 1fr 1fr; } }
.sw-crash { border-inline-start: 4px solid var(--red); }
[hidden] { display: none !important; }
