:root {
  --rts-primary: #0a4d8c;
  --rts-primary-dark: #073a6b;
  --rts-accent: #f39200;
  --rts-bg: #f4f6f9;
  --rts-card: #ffffff;
  --rts-text: #1f2933;
  --rts-muted: #6b7280;
  --rts-border: #e2e8f0;
  --rts-ok: #198754;
  --rts-err: #dc3545;
  --radius: 10px;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

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

.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: var(--rts-primary); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none; }
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); flex: 0 0 auto;
}
.brand-logo { height: 40px; width: 40px; display: block; border-radius: 50%; }
.brand-name { font-weight: 600; font-size: 1.15rem; letter-spacing: .2px; }
.lang-switch select {
  background: var(--rts-primary-dark); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 6px; padding: .35rem .5rem; font-size: .9rem;
}

/* Hero banner (Automechanika) */
.hero { display: block; margin: 1.25rem 0 .25rem; }
.hero img {
  display: block; width: 100%; height: auto; border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(10,77,140,.15);
}

/* Steps */
.steps { display: flex; gap: .5rem; margin: 1.5rem 0; }
.step { flex: 1; text-align: center; padding: .5rem; border-bottom: 3px solid var(--rts-border); color: var(--rts-muted); }
.step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--rts-border);
  color: var(--rts-muted); font-weight: 700; margin-bottom: .25rem;
}
.step .step-label { display: block; font-size: .8rem; }
.step.active { border-color: var(--rts-primary); color: var(--rts-primary); font-weight: 600; }
.step.active .step-num { background: var(--rts-primary); color: #fff; }
.step.done { border-color: var(--rts-ok); color: var(--rts-ok); }
.step.done .step-num { background: var(--rts-ok); color: #fff; }

/* Cards & forms */
.card { background: var(--rts-card); border: 1px solid var(--rts-border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
h1 { font-size: 1.5rem; margin-top: .25rem; }
h2 { font-size: 1.15rem; }
label { display: block; font-weight: 600; margin: .85rem 0 .3rem; }
.form-control, select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--rts-border);
  border-radius: 8px; font-size: 1rem; background: #fff;
}
.form-control:focus, select:focus { outline: none; border-color: var(--rts-primary); box-shadow: 0 0 0 3px rgba(10,77,140,.15); }
/* intl-tel-input: let the flag-dropdown wrapper span the form width. */
.iti { width: 100%; }
.help, .errorlist { font-size: .85rem; }
.errorlist { color: var(--rts-err); list-style: none; padding: 0; margin: .25rem 0; }

/* Buttons */
.btn { display: inline-block; padding: .65rem 1.3rem; border-radius: 8px; border: none; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--rts-primary); color: #fff; }
.btn-primary:hover { background: var(--rts-primary-dark); }
.btn-secondary { background: #fff; color: var(--rts-primary); border: 1px solid var(--rts-primary); }
.btn-row { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Slot grid & date chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.chip { padding: .5rem .9rem; border: 1px solid var(--rts-border); border-radius: 20px; background: #fff; cursor: pointer; font-size: .95rem; }
.chip.selected { background: var(--rts-primary); color: #fff; border-color: var(--rts-primary); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.slot { padding: .6rem; text-align: center; border: 1px solid var(--rts-border); border-radius: 8px; background: #fff; cursor: pointer; }
.slot.selected { background: var(--rts-accent); color: #fff; border-color: var(--rts-accent); }
.empty { color: var(--rts-muted); font-style: italic; }

/* Summary */
.summary dt { font-weight: 600; color: var(--rts-muted); }
.summary dd { margin: 0 0 .6rem; }

/* Alerts */
.messages { margin: 1rem 0; }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; }
.alert-error, .alert-danger { background: #fde8e8; color: #9b1c1c; }
.alert-success { background: #def7ec; color: #03543f; }
.alert-warning { background: #fdf6b2; color: #723b13; }
.alert-info { background: #e1effe; color: #1e429f; }

/* Footer */
.site-footer { margin-top: 2rem; padding: 1rem 0; color: var(--rts-muted); text-align: center; }
.muted { color: var(--rts-muted); }
.footer-staff { display: block; margin-top: .35rem; font-size: .8rem; }
.footer-staff a { color: var(--rts-muted); }

/* ---------------------------------------------------------------------- */
/* Shared internal calendar (v0.1.3)                                       */
/* ---------------------------------------------------------------------- */
.agenda-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: space-between; margin-bottom: 1rem; }
.agenda-bar h1 { margin: 0; }
.agenda-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toggle-group { display: inline-flex; border: 1px solid var(--rts-border); border-radius: 8px; overflow: hidden; }
.toggle-group button { border: none; background: #fff; padding: .5rem .9rem; cursor: pointer; font-weight: 600; color: var(--rts-muted); }
.toggle-group button.active { background: var(--rts-primary); color: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.legend-item { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 1px solid var(--rts-border); border-radius: 20px; background: #fff; cursor: pointer; font-size: .85rem; user-select: none; }
.legend-item.off { opacity: .4; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }

.cal-scroll { overflow-x: auto; padding-bottom: .5rem; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(var(--cal-days), minmax(150px, 1fr)); gap: 0; min-width: 540px; }
.cal-head { font-weight: 600; text-align: center; padding: .5rem 0; border-bottom: 2px solid var(--rts-border); font-size: .9rem; position: sticky; top: 0; background: var(--rts-card); }
.cal-axis, .cal-col { position: relative; }
.cal-hour-label { position: absolute; right: 6px; font-size: .72rem; color: var(--rts-muted); transform: translateY(-50%); }
.cal-col { border-left: 1px solid var(--rts-border); }
.cal-hline { position: absolute; left: 0; right: 0; border-top: 1px dashed #eef1f5; }
.cal-event { position: absolute; left: 3px; right: 3px; border-radius: 6px; color: #fff; padding: 3px 6px; font-size: .74rem; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.cal-event b { display: block; font-size: .78rem; }
.cal-event small { opacity: .9; }

.agenda-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.agenda-table th, .agenda-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rts-border); vertical-align: top; }
.agenda-table th { color: var(--rts-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.conflict-box { border: 1px solid var(--rts-err); background: #fff6f6; border-radius: 8px; padding: 1rem; margin: 1rem 0; }
