*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #dc2626;
  --accent-hover: #b91c1c;
  --bg-panel: #0d1117;
  --bg-field: #161b22;
  --border: rgba(255,255,255,.08);
  --border-focus: rgba(220,38,38,.6);
  --ink: #f0f4f8;
  --muted: #8b949e;
  --radius: 12px;
}

html, body {
  height: 100%;
  font-family: 'Poppins', sans-serif;
  background: var(--bg-panel);
  color: var(--ink);
}

/* ===== LAYOUT SPLIT ===== */
.split {
  display: flex;
  min-height: 100vh;
}

/* ===== PANNEAU GAUCHE ===== */
.split-visual {
  flex: 1 1 55%;
  position: relative;
  overflow: hidden;
  min-height: 300px;
}
.split-visual-bg {
  position: absolute;
  inset: 0;
  background: url('assets/fond.png') center center / cover no-repeat;
}
.split-visual-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(5,8,12,.85) 0%,
    rgba(110,10,10,.45) 60%,
    rgba(5,8,12,.75) 100%
  );
}
.split-visual-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 44px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(240,244,248,.65);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  transition: color .2s;
}
.back-link svg { width: 16px; height: 16px; stroke-width: 2.5; flex-shrink: 0; }
.back-link:hover { color: #fff; }

.visual-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.visual-brand img {
  width: 50px; height: 50px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.visual-brand-name { font-size: 1.15rem; font-weight: 800; }
.visual-brand-tag  { font-size: .7rem; color: rgba(240,244,248,.45); font-weight: 400; margin-top: 1px; }

.visual-headline h2 {
  font-size: clamp(1.8rem, 2.8vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.visual-headline h2 span { color: var(--accent); }
.visual-headline p {
  margin-top: 14px;
  font-size: .85rem;
  color: rgba(240,244,248,.5);
  max-width: 360px;
  line-height: 1.65;
}
.visual-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.badge {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: .7rem;
  font-weight: 600;
  color: rgba(240,244,248,.6);
  backdrop-filter: blur(8px);
}

/* ===== PANNEAU DROIT ===== */
.split-form {
  flex: 0 0 490px;
  max-width: 490px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 44px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

/* ===== TABS ===== */
.form-heading { margin-bottom: 4px; }
.form-heading h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.form-heading p  { margin-top: 4px; font-size: .8rem; color: var(--muted); }

.form-tabs {
  display: flex;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin: 22px 0 24px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 7px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tab-btn.active { background: var(--accent); color: #fff; }

/* ===== FIELDS ===== */
.form-body { display: flex; flex-direction: column; gap: 13px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: .71rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.field input {
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: .88rem;
  padding: 12px 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: rgba(139,148,158,.4); }
.field input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== TERMS ===== */
.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 2px;
}
.terms input[type="checkbox"] {
  width: 15px; height: 15px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.terms label { font-size: .76rem; color: var(--muted); line-height: 1.5; cursor: pointer; }
.terms label a { color: var(--accent); text-decoration: none; }
.terms label a:hover { text-decoration: underline; }

/* ===== BTN SUBMIT ===== */
.btn-submit {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  padding: 14px;
  margin-top: 4px;
  width: 100%;
  transition: background .15s, box-shadow .2s, transform .1s;
  letter-spacing: .01em;
}
.btn-submit:hover { background: var(--accent-hover); box-shadow: 0 6px 22px rgba(220,38,38,.38); }
.btn-submit:active { transform: scale(.98); }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== MESSAGES ===== */
.msg { border-radius: 9px; font-size: .78rem; padding: 10px 13px; display: none; margin-bottom: 2px; line-height: 1.4; }
.msg-error   { background: rgba(127,29,29,.22); border: 1px solid rgba(185,28,28,.35); color: #fca5a5; }
.msg-success { background: rgba(20,83,45,.22);  border: 1px solid rgba(21,128,61,.35);  color: #86efac; }

/* ===== ÉTAT CONNECTÉ ===== */
.logged-wrap { display: none; flex-direction: column; gap: 0; }
.logged-avatar {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--accent), #7f1d1d);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff;
  margin-bottom: 14px;
}
.logged-name { font-size: 1.08rem; font-weight: 700; margin-bottom: 3px; }
.logged-uid  { font-size: .78rem; color: var(--muted); margin-bottom: 22px; }

.logged-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.logged-table td { padding: 9px 0; font-size: .81rem; border-bottom: 1px solid var(--border); }
.logged-table td:first-child { color: var(--muted); width: 44%; }
.logged-table td:last-child   { font-weight: 500; }

.btn-logout {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: .83rem;
  font-weight: 600;
  padding: 11px;
  width: 100%;
  transition: background .2s, color .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.09); color: var(--ink); }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  .split { flex-direction: column; }
  .split-visual { flex: 0 0 200px; }
  .visual-bottom { display: none; }
  .split-form { flex: none; max-width: 100%; padding: 32px 24px 44px; border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}
