/* The Roadbook — pages de l'espace organisateur (compte, mes rallyes, assistant de création). */
body { background: var(--canvas); }
[hidden] { display: none !important; }
.nav .nav-account { display: flex; align-items: center; gap: 18px; }
.nav .nav-account a, .nav .nav-account button { color: rgba(245,245,247,.8); font: 400 13px/1 var(--sans); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.nav .nav-account a:hover, .nav .nav-account button:hover { color: #fff; }
.nav .nav-account .who { color: rgba(245,245,247,.55); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cartes de formulaire */
.account-page { min-height: calc(100vh - 52px); padding: 64px 0 80px; }
.card { width: min(440px, 100% - 32px); margin: 0 auto; background: #fff; border-radius: 28px; padding: 36px 32px; box-shadow: 0 20px 50px -30px rgba(0,0,0,.35); }
.card h1 { font-size: 30px; letter-spacing: -0.03em; margin-bottom: 8px; }
.card .intro { color: var(--muted); margin-bottom: 22px; }
.switch-mode { margin-top: 22px; text-align: center; font-size: 15px; color: var(--muted); }
.switch-mode a { font-weight: 600; text-decoration: none; }

.field { display: block; margin-top: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field > span small { font-weight: 400; color: var(--muted); }
.field input, .field textarea { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); }
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.form-error { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #FFF1F0; color: #D70015; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-block { width: 100%; margin-top: 24px; }
button.btn { cursor: pointer; }
.btn-danger { color: #D70015; }

/* Mes rallyes */
.space-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.space-head h1 { font-size: clamp(32px, 5vw, 44px); letter-spacing: -0.035em; }
.space-head p { color: var(--muted); margin-top: 6px; }
.rally-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.rally-tile { display: flex; flex-direction: column; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 34px -24px rgba(0,0,0,.4); }
.rally-cover { position: relative; aspect-ratio: 1; display: block; color: #fff; text-decoration: none; background-size: cover; background-position: center; }
.rally-cover .road { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .3; }
.rally-cover .band { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: rgba(0,0,0,.42); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.rally-cover .band b { display: block; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rally-cover .band small { display: block; font-size: 12px; opacity: .85; }
.rally-cover .band > div { min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #fff; overflow: hidden; border: 1.5px solid rgba(255,255,255,.9); font: 700 12px/1 var(--sans); color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.status { position: absolute; top: 10px; left: 10px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--text); }
.status.todo { background: #FFD60A; color: #1D1D1F; }
.rally-actions { display: flex; gap: 6px; padding: 10px; }
.rally-actions a, .rally-actions button { flex: 1; text-align: center; padding: 9px 6px; border-radius: 12px; font: 500 14px/1.1 var(--sans); text-decoration: none; color: var(--text); background: var(--canvas); border: 0; cursor: pointer; }
.rally-actions a:hover, .rally-actions button:hover { background: #E8E8ED; }
.rally-actions .primary { background: var(--blue); color: #fff; }
.rally-actions .primary:hover { background: var(--navy-hover); }
.rally-actions .icon { flex: 0 0 38px; }
.new-tile { aspect-ratio: auto; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: 2px dashed var(--line); border-radius: 22px; color: var(--text); text-decoration: none; background: transparent; font-weight: 600; }
.new-tile:hover { border-color: var(--blue); color: var(--blue); }
.new-tile .plus { width: 54px; height: 54px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 30px; font-weight: 400; }
.empty-note { color: var(--muted); margin: 6px 0 28px; }
.app-note { margin-top: 44px; padding: 20px 22px; background: #fff; border-radius: 18px; color: var(--muted); font-size: 15px; }
.app-note b { color: var(--text); }

/* Assistant de création */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; padding: 44px 0 80px; }
.wz-steps { display: flex; gap: 8px; margin-bottom: 26px; list-style: none; padding: 0; flex-wrap: wrap; }
.wz-steps li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.wz-steps li + li::before { content: ""; width: 22px; height: 1px; background: var(--line); }
.wz-steps li i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; background: #E8E8ED; color: var(--muted); }
.wz-steps li.on { color: var(--text); }
.wz-steps li.on i { background: var(--blue); color: #fff; }
.wz-steps li.done i { background: var(--text); color: #fff; }
.step-card { width: auto; margin: 0; padding: 34px 34px 30px; }
.step-card h1 { font-size: 32px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.step-nav .btn { min-width: 140px; }

.choice-title { font-size: 14px; font-weight: 600; margin: 24px 0 10px; }
.choice-title small { font-weight: 400; color: var(--muted); }
.logo-pick { display: flex; align-items: center; gap: 16px; }
.logo-box { width: 84px; height: 84px; border-radius: 20px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; background: var(--canvas); color: var(--muted); font-size: 12px; text-align: center; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #fff; }
.pick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-light { background: var(--canvas); color: var(--text); padding: 10px 18px; font-size: 15px; cursor: pointer; }
.btn-light:hover { background: #E8E8ED; }

.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.palette { border: 2px solid transparent; border-radius: 16px; padding: 6px; background: var(--canvas); cursor: pointer; text-align: center; font: 500 12px/1.2 var(--sans); color: var(--text); }
.palette span { display: flex; height: 38px; border-radius: 11px; overflow: hidden; margin-bottom: 6px; }
.palette span i { flex: 2; }
.palette span i + i { flex: 1; }
.palette.on { border-color: var(--text); background: #fff; }
.custom-colors { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.custom-colors label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.custom-colors input { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }

.fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.font-opt { border: 2px solid transparent; border-radius: 16px; padding: 14px; background: var(--canvas); cursor: pointer; text-align: left; color: var(--text); }
.font-opt b { display: block; font-size: 22px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-opt small { display: block; margin-top: 4px; font: 500 12px/1 var(--sans); color: var(--muted); }
.font-opt.on { border-color: var(--text); background: #fff; }

.cover-pick { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted); background: var(--canvas) center / cover no-repeat; overflow: hidden; text-align: center; font-size: 15px; cursor: pointer; }
.cover-pick.has { border-style: solid; border-color: transparent; color: transparent; }
.toggle { display: flex; align-items: flex-start; gap: 14px; margin-top: 22px; padding: 16px; background: var(--canvas); border-radius: 16px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--blue); flex: none; margin: 1px 0 0; }
.toggle b { display: block; font-size: 15px; }
.toggle small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }

/* Aperçu en direct */
.preview { position: sticky; top: 76px; }
.preview h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.phone { width: 300px; margin: 0 auto; border-radius: 44px; background: #0E1013; padding: 12px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.phone-screen { border-radius: 34px; overflow: hidden; background: #F2F2F7; height: 470px; display: flex; flex-direction: column; }
.pv-header { padding: 46px 18px 20px; color: var(--on-primary, #fff); background: var(--primary, #040A1C); }
.pv-row { display: flex; align-items: center; gap: 12px; }
.pv-logo { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; color: var(--primary, #040A1C); font: 700 18px/1 var(--sans); }
.pv-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.pv-org { font-size: 13px; opacity: .85; font-weight: 500; }
.pv-name { font-size: 22px; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.pv-welcome { margin-top: 14px; font-size: 14px; line-height: 1.35; opacity: .92; }
.pv-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pv-line { height: 12px; border-radius: 6px; background: #E1E1E6; }
.pv-go { margin-top: 6px; height: 46px; border-radius: 14px; background: var(--accent, #E10600); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 16px; }
.preview .rally-tile { width: 220px; margin: 22px auto 0; }

@media (max-width: 900px) {
  .wizard { grid-template-columns: 1fr; }
  .preview { position: static; }
  .preview .phone { transform: scale(.85); transform-origin: top center; margin-bottom: -70px; }
}
@media (max-width: 560px) {
  .step-card { padding: 26px 20px; }
  .fonts { grid-template-columns: 1fr 1fr; }
  .font-opt b { font-size: 18px; }
  .nav .nav-account .who { display: none; }
}
.danger-zone { margin-top: 28px; text-align: center; }
.danger-zone button { background: none; border: 0; color: var(--muted); font: 400 14px/1 var(--sans); text-decoration: underline; cursor: pointer; }
.danger-zone button:hover { color: #D70015; }
