/* Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --bg: #f7f8fc;
  --panel: #ffffff;
  --panel2: #f0f4ff;
  --border: #e6e9f1;
  --text: #0f172a;
  --muted: #5b6475;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --ok: #16a34a;
  --warn: #eab308;
  --bad: #ef4444;
  --shadow: 0 14px 45px rgba(15, 23, 42, 0.08), 0 5px 18px rgba(15, 23, 42, 0.06);
}

html, body { height: 100%; }

body{
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans";
  background: radial-gradient(1800px 1200px at 12% 10%, rgba(37,99,235,0.10), transparent 55%),
              radial-gradient(1400px 1000px at 88% 15%, rgba(16,185,129,0.10), transparent 50%),
              var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.55;
}

/* App full screen */
.app{
  width: min(1200px, 100vw);
  margin: 0 auto;
  min-height: 100vh;
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 28px) clamp(24px, 4vw, 36px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2vw, 22px);
}

/* Header */
.top{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(12px, 2vw, 20px);
  align-items: center;
}

h1{
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  letter-spacing: 0.1px;
}

.subtitle{
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.1vw, 1.05rem);
}

.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.pill{
  background: #fff;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #0f172a;
  font-size: 0.96rem;
  box-shadow: var(--shadow);
}

.pill-icon{ flex-shrink: 0; }

/* Main layout */
.layout{
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(12px, 2vw, 20px);
}

.panel{
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(14px, 2vw, 20px);
  overflow: auto;
  box-shadow: var(--shadow);
}

.panel-right{
  background: linear-gradient(180deg, #fff, #f9fbff);
}

.panel-head{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.panel-head h2{
  font-size: 1.05rem;
  font-weight: 650;
}

.muted{ color: var(--muted); }

/* Switch cards */
.switch{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.switch-card{
  position: relative;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.switch-card:hover{
  transform: translateY(-1px);
  border-color: rgba(37,99,235,0.45);
  box-shadow: 0 10px 30px rgba(37,99,235,0.08);
}

.switch-card.active{
  border-color: rgba(37,99,235,0.7);
  background: rgba(37,99,235,0.08);
  box-shadow: 0 12px 34px rgba(37,99,235,0.12);
}

.switch-card input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-title{
  font-weight: 700;
  font-size: 1rem;
}

.switch-desc{
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Blocks */
.block{
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.04);
}

label{
  display: block;
  font-weight: 650;
  margin-bottom: 8px;
}

.helper{
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

textarea{
  width: 100%;
  border-radius: 12px;
  border: 1px solid #d9e0ec;
  background: #fff;
  padding: 12px;
  color: var(--text);
  font-size: 0.98rem;
  min-height: 160px;
  max-height: 260px;
  resize: none;
  outline: none;
}

textarea:focus{
  border-color: rgba(37,99,235,0.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

/* Buttons */
.btn{
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:active{ transform: translateY(1px); }

.btn:disabled,
.btn.disabled{
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.primary{
  background: var(--accent);
  border-color: rgba(37,99,235,0.25);
  color: white;
  box-shadow: 0 12px 26px rgba(37,99,235,0.28);
}

.primary:hover{ background: var(--accent2); }

.ghost{
  width: auto;
  margin-top: 0;
  background: #eef2ff;
  border-color: var(--border);
  color: #1e3a8a;
}

.ghost:hover{
  border-color: rgba(37,99,235,0.45);
}

.copy-btn.copied{
  background: #16a34a;
  border-color: #15803d;
  color: #fff;
  box-shadow: 0 12px 26px rgba(22,163,74,0.25);
}

/* Email */
.h3{
  font-size: 1rem;
  margin-bottom: 10px;
}

/* ✅ FIX: steps text was white */
.steps{
  margin-left: 18px;
  color: var(--text);
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.steps li{
  color: var(--text);
}

.copybox{
  margin-top: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 14px;
  padding: 12px;
}

.copybox-label{
  font-weight: 650;
  margin-bottom: 8px;
}

.copyrow{
  display: flex;
  gap: 10px;
  align-items: center;
}

.copyinput{
  flex: 1;
  border-radius: 12px;
  border: 1px solid #d9e0ec;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.copyhint{
  margin-top: 8px;
  min-height: 18px;
}

/* Waiting */
.waiting-state{
  margin-top: 12px;
  border-radius: 14px;
  padding: 16px;
  border: 1px dashed #d9e0ec;
  background: #f8fafc;
  text-align: center;
}

.spinner{
  width: 34px;
  height: 34px;
  border: 3px solid #e2e8f0;
  border-top-color: rgba(37,99,235,0.9);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.wait-title{
  font-weight: 750;
  margin-bottom: 4px;
}

/* Results */
.result-wrap{
  display: grid;
  gap: 10px;
}

.result-card{
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 14px;
}

/* ✅ FIX: badge border was white */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.badge.ok{ background: #ecfdf3; color: #166534; border-color: #bbf7d0; }
.badge.warn{ background: #fef8e7; color: #92400e; border-color: #fed7aa; }
.badge.bad{ background: #fef2f2; color: #b91c1c; border-color: #fecdd3; }

/* ✅ New: neutral badge (for "En attente") */
.badge.neutral{ background: #eef2ff; color: #1e3a8a; border-color: #c7d2fe; }

.result-text{
  color: var(--text);
  margin-bottom: 10px;
}

.advice{
  color: var(--muted);
  border-left: 3px solid #d9e0ec;
  padding-left: 10px;
}

.mini-checklist{
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}

.mini-title{
  font-weight: 800;
  margin-bottom: 8px;
}

/* ✅ FIX: mini checklist text was white */
.mini-checklist ul{
  margin-left: 18px;
  color: var(--text);
  display: grid;
  gap: 6px;
}

.mini-checklist li{
  color: var(--text);
}

/* Footer */
.bottom{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fafc;
}

/* Helpers */
.hidden{ display: none !important; }

/* Responsive */
@media (max-width: 900px){
  .app{ height: auto; min-height: 100vh; width: 100%; }
  .top{ grid-template-columns: 1fr; }
  .layout{ grid-template-columns: 1fr; }
  .switch{ grid-template-columns: 1fr; }
  .copyrow{ flex-direction: column; align-items: stretch; }
  .ghost{ width: 100%; }
}
