:root {
  color-scheme: light;
  --bg: #f4f0eb;
  --accent: #ded0ba;
  --gold: #a8825c;
  --ink: #1a1a18;
  --muted: #757575;
  --card: #ffffff;
  --field: #faf8f5;
  --line: #e6dccd;
  --danger: #b3261e;
  --display: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(222, 208, 186, 0.55), transparent 60%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

.page {
  width: 100%;
  max-width: 460px;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- logo ------------------------------------------------------------------ */

.hero {
  display: flex;
  justify-content: center;
}

.logo {
  display: block;
}

.logo img {
  display: block;
  width: min(320px, 82vw);
  height: auto;
}

/* --- karta a formulář ------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid rgba(222, 208, 186, 0.7);
  border-radius: 24px;
  padding: 26px 20px 22px;
  box-shadow: 0 1px 2px rgba(26, 26, 24, 0.04), 0 12px 32px -18px rgba(26, 26, 24, 0.18);
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
}

h1 {
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 26px;
  line-height: 1.15;
  text-wrap: balance;
}

.lead {
  margin: 6px 0 0;
  color: var(--muted);
}

form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-size: 14px;
  font-weight: 500;
}

input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font: 400 16px/1 var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(222, 208, 186, 0.75);
}

input[aria-invalid='true'] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  min-height: 0;
  color: var(--danger);
  font-size: 13px;
}

.field-error:empty {
  display: none;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fbeceb;
  color: var(--danger);
  font-size: 14px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- tlačítka ---------------------------------------------------------------- */

.btn {
  position: relative;
  width: 100%;
  height: 54px;
  margin-top: 4px;
  border-radius: 999px;
  font: 600 14.5px/1 var(--text);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.985);
}

.btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.btn-primary {
  border: 0;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #000;
}

.btn-secondary {
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--accent);
}

.spinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(244, 240, 235, 0.35);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn[aria-busy='true'] {
  cursor: progress;
}

.btn[aria-busy='true'] .btn-label {
  visibility: hidden;
}

.btn[aria-busy='true'] .spinner {
  display: block;
}

.consent {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-wrap: balance;
}

/* --- success state ------------------------------------------------------------- */

.success {
  text-align: center;
  outline: none;
  animation: rise 0.35s ease-out;
}

.success-icon {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
}

.call {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.call .lead {
  margin: 0 0 14px;
  color: var(--ink);
  font-weight: 500;
}

.calendar {
  margin-top: 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.calendar iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 0;
  background: #fff;
}

.calendar-link {
  display: block;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* --- patička ----------------------------------------------------------------- */

.footer {
  margin-top: auto;
  text-align: center;
  font-size: 13px;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
}

/* --- admin ------------------------------------------------------------------- */

.admin-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px 40px;
}

.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.btn-small {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: 44px;
  margin: 0;
  padding: 0 22px;
  font-size: 13px;
  text-decoration: none;
}

.table-wrap {
  background: var(--card);
  border: 1px solid rgba(222, 208, 186, 0.7);
  border-radius: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1ebe2;
  vertical-align: top;
}

tr:last-child td {
  border-bottom: 0;
}

td a {
  color: var(--ink);
}

.empty {
  margin: 0;
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 640px) {
  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
  }

  tr:last-child {
    border-bottom: 0;
  }

  td {
    padding: 3px 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (min-width: 720px) {
  .page {
    justify-content: center;
    gap: 32px;
  }

  .card {
    padding: 36px 32px 28px;
  }

  h1 {
    font-size: 36px;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
