/* Parapheo — interface (thème « écriture », encre & or) */
:root {
  --ink: #161b26;        /* encre profonde */
  --ink-2: #1f2634;
  --gold: #b08c45;       /* or / laiton */
  --gold-light: #d6bc80;
  --accent: #b08c45;
  --bg: #f6f4ef;         /* papier ivoire */
  --card: #ffffff;
  --text: #1c2430;
  --muted: #77716a;
  --border: #e6e1d6;
  --danger: #b34040;
  --radius: 12px;
  --serif: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ---- barre du haut ---- */
.topbar {
  background: linear-gradient(135deg, #12161f 0%, #1d2433 100%);
  color: #fff;
  border-bottom: 2px solid var(--gold);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark { color: var(--gold-light); font-size: 18px; }
.version-badge {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 11px; font-weight: 600; color: var(--gold-light);
  background: rgba(176,140,69,.14);
  border: 1px solid rgba(176,140,69,.45); border-radius: 999px;
  padding: 1px 8px; margin-left: 4px;
  letter-spacing: .02em;
}
.nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #cfc9bd;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(176,140,69,.22); color: var(--gold-light); }
.nav-sep { color: #56607a; margin: 0 2px; }
.nav-company { color: var(--gold-light); font-size: 13px; font-weight: 600; padding: 0 4px; }
.userbox { display: flex; align-items: center; gap: 12px; }
.user-email { color: #a49a88; font-size: 13px; }

/* ---- contenu ---- */
.container { max-width: 1080px; margin: 28px auto 60px; padding: 0 20px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 0 40px; }
.footer a { color: var(--gold); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

h1 { font-family: var(--serif); font-size: 27px; font-weight: 700; margin: 0 0 6px; letter-spacing: .01em; }
h2 { font-family: var(--serif); font-size: 19px; margin: 0 0 14px; }
.page-sub { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(23,27,38,.04);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- formulaires ---- */
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 5px; color: #3d3a33; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176,140,69,.18);
}
input[type=color] {
  width: 52px; height: 36px; padding: 2px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.color-combo { display: flex; gap: 8px; align-items: center; }
.color-combo .hex-code {
  width: 96px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  text-transform: lowercase;
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-row input[type=checkbox] { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--gold); }
.checkbox-row label { font-weight: 500; }

/* ---- boutons ---- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f3ecdd;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--ink-2); border-color: var(--gold); }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #9a7a3a; border-color: #9a7a3a; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f4f0e7; border-color: var(--gold); }
.btn-danger { background: #fff; color: var(--danger); border-color: #ecd3d3; }
.btn-danger:hover { background: #f9efef; }
.btn-ghost { background: transparent; color: #cfc9bd; border-color: #454e61; }
.btn-ghost:hover { background: rgba(255,255,255,.08); }

/* ---- tableaux ---- */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
  padding: 8px 10px; border-bottom: 2px solid var(--border);
}
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list .actions { text-align: right; white-space: nowrap; }
table.list .actions .btn { margin-left: 6px; }

/* ---- divers ---- */
.flash { padding: 11px 15px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash-success { background: #eef3e6; color: #48601d; border: 1px solid #d5e0bd; }
.flash-error { background: #f9efef; color: #a33; border: 1px solid #ecd3d3; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: #f2ead9; color: #8a6d2f;
}
.badge-pending { background: #fbe9d2; color: #9a5b16; }
.logo-preview {
  max-height: 60px; max-width: 180px;
  border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff;
}
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }

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

/* ---- pages d'accueil / connexion / inscription ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-side {
  flex: 1.1;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(176,140,69,.20), transparent 60%),
    linear-gradient(150deg, #10141d 0%, #1b2231 55%, #232c40 100%);
  color: #efe9dc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}
.auth-side::after {           /* filet doré vertical */
  content: '';
  position: absolute; top: 0; right: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
}
.auth-side .nib {
  font-size: 44px;
  color: var(--gold-light);
  margin-bottom: 18px;
}
.auth-side h1 {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: .03em;
  margin: 0 0 6px;
  color: #f6f1e6;
}
.auth-side .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--gold-light);
  margin: 0 0 26px;
}
.auth-side .pitch {
  font-size: 15px;
  line-height: 1.75;
  color: #c9c2b2;
  max-width: 430px;
  margin: 0 0 30px;
}
.auth-side .reserved {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid rgba(176,140,69,.5);
  border-radius: 999px;
  padding: 7px 16px;
  width: max-content;
}
.auth-side .powered {
  position: absolute;
  bottom: 26px; left: 64px;
  font-size: 13px;
  color: #8f8776;
}
.auth-side .powered a { color: var(--gold-light); text-decoration: none; }
.auth-side .powered a:hover { text-decoration: underline; }

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 28px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 30px 32px;
  box-shadow: 0 10px 40px rgba(23,27,38,.08);
}
.auth-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 4px;
}
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.auth-alt {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--muted);
  text-align: center;
}
.auth-alt a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }
.auth-footer-mobile { display: none; }

@media (max-width: 860px) {
  .auth-page { flex-direction: column; }
  .auth-side { padding: 44px 28px 36px; flex: none; }
  .auth-side h1 { font-size: 38px; }
  .auth-side .powered { position: static; margin-top: 26px; }
  .auth-side::after { display: none; }
}

/* ---- aperçu signature ---- */
.sig-preview {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  overflow-x: auto;
}
.sig-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.code-block {
  background: #12161f; color: #ded5c2;
  border-radius: 8px; padding: 14px 16px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-all;
  max-height: 260px; overflow: auto;
}
details.help { margin-top: 18px; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--gold); }
details.help .help-body { margin-top: 10px; color: #3d3a33; font-size: 14px; }
details.help ol { padding-left: 20px; }
details.help li { margin-bottom: 6px; }
