/* ============================================================
   RAWA TAIF COMPANY — feuille de style commune (site + configurateur + admin)
   Palette : bleu marine / bleu clair, reprise du logo.
   (--brass est conservé comme nom de variable : c'est la couleur d'accent.)
   ============================================================ */
:root {
  --navy: #123a56;
  --navy-2: #1a4d71;
  --brass: #2f96d4;
  --brass-dark: #1f77ac;
  --paper: #f4f7fa;
  --ink: #16283a;
  --muted: #64748b;
  --line: #d9e2ea;
  --ok: #2e9e5b;
  --bad: #c94f4f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(18, 58, 86, .12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 58, 86, .97);
  color: #fff;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(47, 150, 212, .35);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .12em; font-size: 1.05rem; }
.brand .logo-img {
  height: 44px; width: auto; display: block;
  background: #fff; border-radius: 8px; padding: 3px 7px;
}
.brand .logo {
  height: 34px; border-radius: 8px; padding: 0 10px;
  background: linear-gradient(135deg, var(--brass), var(--brass-dark));
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .95rem; letter-spacing: .08em;
}
.brand em { color: var(--brass); font-style: normal; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { text-decoration: none; font-size: .93rem; opacity: .85; }
.nav a:hover { opacity: 1; color: var(--brass); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  border: 0; border-radius: 999px; font-weight: 600; font-size: .95rem;
  padding: 13px 28px; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-gold { background: linear-gradient(135deg, var(--brass), var(--brass-dark)); color: #fff; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(47, 150, 212, .4); }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-ghost:hover { border-color: var(--brass); color: var(--brass); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-danger { background: #fbeaea; color: var(--bad); border: 1px solid #f0c8c8; }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ---------- Héros ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(47, 150, 212, .18), transparent 60%),
    linear-gradient(165deg, var(--navy) 0%, var(--navy-2) 70%, #1d3350 100%);
  color: #fff; padding: 96px 0 110px; position: relative; overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.12; font-weight: 800; }
.hero h1 em { color: var(--brass); font-style: normal; }
.hero p.lead { margin: 22px 0 34px; font-size: 1.12rem; opacity: .88; max-width: 32em; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-visual svg { width: 100%; height: auto; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35)); }
.kicker { display: inline-block; color: var(--brass); letter-spacing: .22em; font-size: .78rem; font-weight: 700; text-transform: uppercase; margin-bottom: 16px; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section.alt { background: #fff; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 10px; }
.section .sub { color: var(--muted); max-width: 44em; margin-bottom: 44px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: 0 4px 14px rgba(14, 26, 43, .05);
}
.card .ico {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(47, 150, 212, .2), rgba(47, 150, 212, .08));
  display: grid; place-items: center; color: var(--brass-dark); font-size: 1.35rem;
}
.card h3 { font-size: 1.08rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .93rem; }
.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; position: relative; }
.step-tile::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-size: 1.9rem; font-weight: 800; color: var(--brass); display: block; margin-bottom: 10px;
}
.step-tile h4 { font-size: .98rem; margin-bottom: 6px; }
.step-tile p { font-size: .86rem; color: var(--muted); }
.cta-band { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; text-align: center; padding: 70px 0; }
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { opacity: .85; margin-bottom: 28px; }

/* ---------- Pied de page ---------- */
footer { background: var(--navy); color: rgba(255, 255, 255, .75); padding: 44px 0; font-size: .9rem; }
footer .container { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--brass); text-decoration: none; }

/* ============================================================
   Configurateur — options à gauche, grand aperçu 3D à droite
   ============================================================ */
.config-wrap { display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, 46%, 640px); gap: 36px; padding: 40px 0 80px; align-items: start; }
.progress { display: flex; gap: 6px; margin-bottom: 30px; flex-wrap: wrap; }
.progress .p-step {
  flex: 1; min-width: 90px; text-align: center; font-size: .74rem; font-weight: 600;
  color: var(--muted); padding: 9px 4px 11px; border-bottom: 3px solid var(--line);
  cursor: pointer; user-select: none; transition: color .15s, border-color .15s;
}
.progress .p-step.done { color: var(--brass-dark); border-color: rgba(47, 150, 212, .45); }
.progress .p-step.current { color: var(--navy); border-color: var(--brass); }
.step-head h2 { font-size: 1.5rem; font-weight: 800; }
.step-head p { color: var(--muted); margin: 6px 0 26px; }
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
/* Étapes finitions (parois, portes, couleur du plafond) : 4 fiches par ligne */
.items-grid.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.items-grid.grid-4 .item-card { padding: 10px; }
.items-grid.grid-4 .item-visual { height: 72px; margin-bottom: 8px; border-radius: 7px; }
.items-grid.grid-4 .item-visual img { height: 72px; }
.items-grid.grid-4 .item-card h4 { font-size: .78rem; margin-bottom: 2px; }
.items-grid.grid-4 .item-card .d { font-size: .7rem; min-height: 2.1em; }
.items-grid.grid-4 .item-card.selected::after { width: 20px; height: 20px; font-size: .7rem; top: 7px; right: 7px; }
@media (max-width: 700px) { .items-grid.grid-4 { grid-template-columns: repeat(2, 1fr); } }
.item-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative;
}
.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.item-card.selected { border-color: var(--brass); box-shadow: 0 6px 18px rgba(47, 150, 212, .25); }
.item-card.selected::after {
  content: "✓"; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px;
  background: var(--brass); color: var(--navy); font-weight: 800; border-radius: 50%;
  display: grid; place-items: center; font-size: .85rem;
}
.item-visual {
  height: 110px; border-radius: 9px; margin-bottom: 12px;
  background: linear-gradient(135deg, #e7edf2, #d3dde6);
  display: grid; place-items: center; color: #93a5b4; font-size: 1.7rem; overflow: hidden;
}
.item-visual img { width: 100%; height: 110px; object-fit: cover; }
.item-card h4 { font-size: .96rem; margin-bottom: 4px; }
.item-card .d { font-size: .82rem; color: var(--muted); min-height: 2.4em; }
.item-card .price { margin-top: 10px; font-weight: 700; font-size: .9rem; color: var(--brass-dark); }
.step-nav { display: flex; justify-content: space-between; margin-top: 34px; }

/* Choix d'emplacement (main courante / miroir) */
.pos-choice { margin: 0 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-label { font-size: .88rem; font-weight: 600; color: var(--navy); margin-right: 4px; }
.pos-btn {
  border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 20px; font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s;
}
.pos-btn:hover { border-color: var(--brass); color: var(--brass-dark); }
.pos-btn.on { border-color: var(--brass); background: rgba(47, 150, 212, .08); color: var(--navy); }

/* Panneau 3D + récapitulatif */
.summary-panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; position: sticky; top: 82px;
}
.summary-panel h3 { font-size: 1.02rem; margin: 4px 0 12px; letter-spacing: .04em; }
.summary-panel #cab3d canvas { display: block; width: 100% !important; }
.cab-preview { margin: 0 auto 18px; display: block; }
.summary-list { list-style: none; font-size: .86rem; }
.summary-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.summary-list .cat { color: var(--muted); }
.summary-list .val { text-align: right; font-weight: 600; }
.summary-total { display: flex; justify-content: space-between; margin-top: 14px; font-weight: 800; font-size: 1.05rem; }
.summary-total .amount { color: var(--brass-dark); }
.summary-note { font-size: .74rem; color: var(--muted); margin-top: 10px; }

/* Formulaire devis */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.form-grid .full { grid-column: 1 / -1; }
label.f { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
input.f, textarea.f, select.f {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: .92rem; background: #fff; color: var(--ink);
}
input.f:focus, textarea.f:focus, select.f:focus { outline: 2px solid rgba(47, 150, 212, .5); border-color: var(--brass); }
.notice { padding: 14px 16px; border-radius: 10px; font-size: .9rem; margin-top: 16px; display: none; }
.notice.ok { display: block; background: #e8f6ee; color: var(--ok); border: 1px solid #bfe6cf; }
.notice.err { display: block; background: #fbeaea; color: var(--bad); border: 1px solid #f0c8c8; }

/* ============================================================
   Administration
   ============================================================ */
.admin-body { background: #eef0f4; }
.login-box {
  max-width: 380px; margin: 12vh auto; background: #fff; padding: 38px 34px;
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: center;
}
.login-box h1 { font-size: 1.2rem; margin-bottom: 22px; }
.admin-tabs { display: flex; gap: 8px; margin: 26px 0 20px; }
.admin-tabs button {
  border: 1px solid var(--line); background: #fff; padding: 9px 20px; border-radius: 999px;
  cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600; color: var(--muted);
}
.admin-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.admin-tabs .badge { background: var(--brass); color: var(--navy); border-radius: 999px; padding: 1px 8px; font-size: .75rem; margin-left: 6px; }
.cat-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; overflow: hidden; }
.cat-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; background: #f7fafc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cat-head h3 { font-size: 1rem; margin-right: auto; }
.cat-head .meta { font-size: .76rem; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; padding: 10px 14px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #e9eff4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.thumb { width: 46px; height: 34px; border-radius: 6px; object-fit: cover; background: #dde5ec; display: block; }
.swatch-dot { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .12); display: inline-block; vertical-align: middle; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.pill.on { background: #e8f6ee; color: var(--ok); }
.pill.off { background: #f2f2f0; color: var(--muted); }
.row-actions { white-space: nowrap; }
.row-actions button { background: none; border: 0; cursor: pointer; font-size: 1rem; padding: 4px 6px; opacity: .65; }
.row-actions button:hover { opacity: 1; }
dialog {
  border: 0; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 30px; width: min(520px, 92vw);
}
dialog::backdrop { background: rgba(14, 26, 43, .55); }
dialog h3 { margin-bottom: 18px; }
dialog .form-grid { margin-bottom: 18px; }
dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 10px; }
.quote-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.quote-card.read { border-left-color: var(--line); opacity: .8; }
.quote-card .qc-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.quote-card .qc-head b { font-size: .98rem; }
.quote-card .qc-meta { font-size: .8rem; color: var(--muted); }
.quote-card ul { list-style: none; font-size: .85rem; margin: 8px 0; }
.quote-card ul li { padding: 2px 0; }
.quote-card .qc-total { font-weight: 800; color: var(--brass-dark); }
.quote-card .qc-msg { font-size: .86rem; background: #f6f9fb; border-radius: 8px; padding: 10px 12px; margin-top: 8px; }

/* ---------- Sélecteur de langue FR / EN ---------- */
.lang-switch {
  display: inline-flex; align-items: center; margin-left: 6px;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; overflow: hidden;
}
.lang-switch a {
  padding: 4px 11px; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-decoration: none; color: rgba(255, 255, 255, .7); opacity: 1; cursor: pointer;
}
.lang-switch a:hover { color: #fff; }
.lang-switch a.on { background: var(--brass); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .grid-3, .steps-row { grid-template-columns: 1fr 1fr; }
  .config-wrap { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
}
@media (max-width: 580px) {
  .grid-3, .steps-row, .form-grid { grid-template-columns: 1fr; }
  /* on masque les liens de nav sur mobile, mais on garde le sélecteur de langue */
  .nav > a { display: none; }
  .nav { gap: 8px; }
}
