:root {
  --brand: #003c7d;
  --brand-2: #006eb2;
  --brand-soft: #e8f0fa;
  --accent: #d72631;
  --ink: #1a1f2b;
  --muted: #5b6472;
  --bg: #f6f7fa;
  --card: #ffffff;
  --border: #e3e6ee;
  --error: #b3001b;
  --error-bg: #fdecef;
  --ok: #2e7d32;
  --info-bg: #eef6fc;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
body.no-scroll { overflow: hidden; }

a { color: var(--brand-2); }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 18px 16px 24px;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
}
.brand {
  background: rgba(255,255,255,0.92);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--brand);
}
.brand--cm::before { content: 'CLINICA MOBILE'; letter-spacing: 1px; }
.brand--renner::before { content: 'RENNER ITALIA'; letter-spacing: 1px; color: var(--accent); }
.site-header__title { max-width: 720px; margin: 18px auto 0; text-align: center; }
.site-header__title h1 { margin: 0; font-size: 1.6rem; font-weight: 700; }
.site-header__title p { margin: 4px 0 0; opacity: .9; font-size: .95rem; }

/* ===== Container & card ===== */
.container { max-width: 720px; margin: 24px auto 64px; padding: 0 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.card--narrow { max-width: 480px; margin: 0 auto; }
.card h2 { margin: 0 0 12px; font-size: 1.4rem; color: var(--brand); }
.card h3 { margin: 1.4em 0 .5em; font-size: 1.05rem; color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }

/* ===== Form ===== */
.form .fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px 8px;
  margin: 18px 0 0;
}
.form legend {
  font-weight: 600;
  color: var(--brand);
  padding: 0 6px;
  font-size: .95rem;
}
.grid { display: grid; gap: 12px; }
.grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) {
  .grid--2 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; margin: 10px 0; }
.field__label { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field__hint  { color: var(--muted); margin-top: 4px; }
.field__err   {
  color: var(--error);
  background: var(--error-bg);
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 6px;
  font-size: .85rem;
}
.field__input {
  font: inherit;
  color: inherit;
  padding: 12px 14px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
.field__input:focus {
  outline: 3px solid rgba(0,110,178,.25);
  border-color: var(--brand-2);
}
.field__input--lg { font-size: 1.5rem; letter-spacing: .3em; text-align: center; }
.field__input--mono { font-family: ui-monospace, monospace; text-transform: uppercase; }

.radio-row { display: flex; gap: 18px; padding: 6px 0 4px; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.radio input { width: 18px; height: 18px; }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 4px;
  cursor: pointer;
}
.check input { margin-top: 4px; width: 18px; height: 18px; }
.check--big { font-weight: 600; font-size: 1.02rem; }
.check--block { background: var(--brand-soft); border-radius: 8px; padding: 12px 14px; margin: 8px 0; }
.link-btn {
  background: none; border: 0; color: var(--brand-2); padding: 0;
  font: inherit; cursor: pointer; text-decoration: underline;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: 600 1rem/1 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn:hover  { background: var(--brand-2); }
.btn:focus  { outline: 3px solid rgba(0,110,178,.4); }
.btn:disabled { background: #99a4b3; cursor: not-allowed; }
.btn--block { display: block; width: 100%; margin-top: 18px; }
.btn--secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn--secondary:hover { background: var(--brand-soft); }

.actions { margin-top: 24px; text-align: center; }
.actions .muted { margin-top: 12px; }

/* ===== Alerts ===== */
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.alert--error { background: var(--error-bg); color: var(--error); border: 1px solid #f4c3cb; }
.alert--info  { background: var(--info-bg); color: var(--brand); border: 1px solid #cfe2f5; }
.alert ol { margin: 8px 0 0 20px; }

/* ===== Confirm page ===== */
.confirm-hero h2 { color: var(--ok); }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 18px 0; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; }
@media (max-width: 600px) {
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 8px; font-size: .85rem; }
}

/* ===== Modals ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(15,25,40,0.55);
  backdrop-filter: blur(2px);
}
.modal__dialog {
  position: relative;
  margin: auto;
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
@media (max-width: 600px) {
  .modal__dialog { max-width: 100%; max-height: 100vh; border-radius: 0; margin: 0; }
}
.modal__header, .modal__footer { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__footer { border-top: 1px solid var(--border); border-bottom: 0; flex-wrap: wrap; }
.modal__header h2 { margin: 0; font-size: 1.1rem; color: var(--brand); flex: 1; }
.modal__close {
  background: none; border: 0; font-size: 1.6rem; color: var(--muted);
  cursor: pointer; padding: 4px 8px; line-height: 1;
}
.modal__body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.modal__body h3 { margin-top: 1.2em; }
.modal__footer .muted { margin: 0; flex: 1; min-width: 200px; }

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
  padding: 24px 16px 40px;
}

/* ===== Page errors ===== */
.page-error { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.page-error .card h1 { font-size: 2.2rem; }
