/* wizard.css — shared UI for the signing apps (note, nda, …).
   Colors come from tokens.css (link it before this file). Document/PDF styling
   lives in doc.css; the note itself is styled there, not here. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 14px; color: var(--text); background: var(--fill); line-height: 1.5;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Header */
.header { background: var(--navy); color: var(--white); padding: 20px 32px; display: flex; align-items: center; gap: 18px; }
.header-logo { font-size: 20px; font-weight: 700; color: var(--sky); letter-spacing: -0.4px; }
.header-logo-link { display: inline-flex; align-items: center; line-height: 0; }
.header-logo-img { height: 48px; width: auto; display: block; }
.header-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.25); }
.header-title { font-size: 15px; font-weight: 600; }
.header-sub { font-size: 12px; color: rgba(255,255,255,0.65); margin-top: 2px; }

/* Steps */
.steps { background: var(--steel); }
.steps-inner { max-width: 900px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: center; }
.step { padding: 10px 20px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.55); border-bottom: 3px solid transparent; cursor: pointer; transition: all .15s; }
.step:first-child { padding-left: 20px; }
.step.active { color: var(--white); border-bottom-color: var(--sky); }

/* Panels */
.panel { display: none; max-width: 900px; margin: 0 auto; padding: 32px 24px 80px; }
.panel.active { display: block; }
.section-heading { font-size: 18px; color: var(--navy); margin-bottom: 6px; }

/* Note preview */
.note-preview { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 16px 0 24px; }
.note-frame { width: 100%; height: 540px; border: 0; display: block; background: #fff; }

/* Cards */
.terms-card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 24px; }
.terms-card-header { background: var(--navy); color: var(--white); padding: 12px 20px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.terms-grid { display: grid; grid-template-columns: 1fr 1fr; }
.term-label { padding: 11px 20px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--fill); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.term-value { padding: 11px 20px; font-size: 13px; font-weight: 600; color: var(--navy); border-bottom: 1px solid var(--border); }
.term-value.money { color: var(--success); font-size: 15px; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit; border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.field input:focus { outline: none; border-color: var(--corn); box-shadow: 0 0 0 3px rgba(85,148,215,.15); }
.field input.invalid { border-color: var(--error); }
.err-msg { display: none; color: var(--error); font-size: 11px; margin-top: 4px; }
.err-msg.show { display: block; }

/* Signature */
.sig-wrapper { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin: 8px 0 16px; }
.sig-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.sig-canvas-wrap { border: 2px dashed var(--border); border-radius: 6px; background: var(--fill); position: relative; height: 160px; overflow: hidden; cursor: crosshair; }
canvas#sigCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.sig-placeholder { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: var(--border); font-size: 13px; font-style: italic; pointer-events: none; user-select: none; transition: opacity .2s; }
.sig-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.btn-clear { font-size: 11px; color: var(--muted); background: none; border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; cursor: pointer; font-family: inherit; }
.btn-clear:hover { background: var(--fill); }

/* Consent */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.consent input { margin-top: 3px; }

/* Buttons / rows */
.action-row { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.btn { font-family: inherit; font-size: 14px; font-weight: 600; padding: 10px 20px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-primary { background: var(--steel); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
.btn-success:disabled { opacity: .6; cursor: default; }
.btn-outline { background: #fff; color: var(--steel); border-color: var(--border); }
.btn-outline:hover { background: var(--fill); }

.dl-link { color: var(--steel); text-decoration: none; font-weight: 600; }
.dl-link:hover { text-decoration: underline; color: var(--navy); }

.submit-error { display: none; color: var(--error); font-size: 13px; margin-top: 14px; text-align: right; }
.submit-error.show { display: block; }

/* Success */
#successPanel { max-width: 640px; }
.success-box { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 40px; text-align: center; }
.success-check { width: 56px; height: 56px; border-radius: 50%; background: var(--success); color: #fff; font-size: 30px; line-height: 56px; margin: 0 auto 16px; }
.success-box h2 { color: var(--navy); margin-bottom: 8px; }
.success-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.success-box .btn { margin: 0 auto; }

@media (max-width: 768px) {
  .header { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 16px 20px; }
  .header-logo-img { height: 42px; }
  .header-divider { display: none; }
  .header-title { font-size: 14px; }
  .steps-inner { padding: 0 16px; overflow-x: auto; }
  .panel { padding: 24px 16px 64px; }
  .action-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .action-row .btn { width: 100%; justify-content: center; padding: 12px 16px; }
}

@media (max-width: 680px) {
  .form-grid, .terms-grid { grid-template-columns: 1fr; }
}
