.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.progress { margin-bottom: var(--space-7); }
.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}
.progress-value { color: var(--brand-600); font-weight: 800; font-variant-numeric: tabular-nums; }
.progress-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  transition: width .5s var(--ease);
}

.panel {
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.panel:focus-within { border-color: var(--brand-300); box-shadow: 0 0 0 4px rgba(20, 184, 172, .12); }
.panel.is-raised { position: relative; z-index: 60; }

.panel-head { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); }
.step {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, var(--brand-500), var(--brand-700));
}
.panel h2 { font-size: var(--fs-md); font-weight: 800; color: var(--ink); }
.panel-sub { font-size: var(--fs-xs); color: var(--ink-muted); margin-top: var(--space-1); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-5); }
.grid > .field { min-width: 0; align-content: start; }
.field-full { margin-top: var(--space-5); }

.panel label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}
.req { color: var(--brand-600); margin-inline-start: 2px; line-height: 1; }
.opt { color: var(--ink-faint); font-weight: 400; font-size: .85em; margin-inline-start: 2px; line-height: 1; }

.panel input[type="text"],
.panel input[type="tel"],
.panel select,
.panel textarea {
  width: 100%;
  padding: .7rem .9rem;
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.panel textarea { resize: vertical; min-height: 110px; line-height: 1.9; }
.panel input::placeholder,
.panel textarea::placeholder { color: var(--ink-faint); }
.panel input:hover,
.panel select:hover,
.panel textarea:hover { border-color: var(--line-strong); }
.panel input:focus,
.panel select:focus,
.panel textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 172, .16);
}

.panel input[inputmode="numeric"] {
  direction: ltr;
  text-align: end;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.panel input[inputmode="numeric"]:placeholder-shown { direction: rtl; text-align: start; letter-spacing: normal; }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-inline-start: 2.2rem; cursor: pointer; }
.select-arrow {
  position: absolute;
  inset-inline-start: .8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--brand-600);
  pointer-events: none;
}

.hint { margin-top: var(--space-2); font-size: var(--fs-xs); color: var(--ink-muted); }

.error {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  color: #B3261E;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .25s var(--ease), opacity .25s var(--ease);
}
.error.is-shown { max-height: 60px; opacity: 1; }

.field.has-error input,
.field.has-error select,
.field.has-error textarea,
.has-error .date-input {
  border-color: #E4A2A0;
  background: #FEF1F1;
}
.field.has-error input:focus,
.field.has-error select:focus,
.field.has-error textarea:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, .12); }
.field.is-valid input,
.field.is-valid select,
.field.is-valid textarea { border-color: var(--brand-300); }

@keyframes register-shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(3px); }
  50% { transform: translateX(-3px); }
}
.field.shake, .upload-row.shake { animation: register-shake .4s var(--ease); }

.datepicker { position: relative; }
.date-input { display: flex; align-items: stretch; gap: var(--space-2); }
.date-input input { flex: 1; }

.icon-btn {
  flex: none;
  width: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--brand-050); color: var(--brand-700); border-color: var(--brand-300); }
.icon-btn[aria-expanded="true"] { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }

.calendar {
  position: absolute;
  z-index: 40;
  top: calc(100% + var(--space-2));
  inset-inline-start: 0;
  width: min(320px, calc(100vw - 48px));
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
}
.calendar[hidden] { display: none; }

.cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-4); }
.cal-nav {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.cal-nav:hover { background: var(--brand-050); color: var(--brand-700); }

.cal-selects { display: flex; gap: var(--space-2); flex: 1; }
.cal-selects select {
  padding: .45rem .5rem;
  font-size: var(--fs-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  text-align-last: center;
}

.cal-weekdays, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekdays { margin-bottom: var(--space-2); font-size: .68rem; color: var(--ink-faint); text-align: center; }
.cal-weekdays span { padding: 4px 0; }

.cal-day {
  aspect-ratio: 1;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.cal-day:hover { background: var(--brand-100); }
.cal-day.is-empty { background: none; border: none; cursor: default; pointer-events: none; }
.cal-day.is-today { border-color: var(--brand-500); color: var(--brand-700); font-weight: 800; }
.cal-day.is-selected { background: var(--brand-500); color: #fff; font-weight: 800; border-color: transparent; }
.cal-day.is-future { opacity: .35; cursor: not-allowed; pointer-events: none; }

.cal-foot { display: flex; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.cal-foot button {
  flex: 1;
  padding: var(--space-2);
  font-size: var(--fs-xs);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.cal-foot button:hover { background: var(--brand-050); color: var(--brand-700); }

.upload-row { display: grid; grid-template-columns: 1fr; gap: var(--space-5); align-items: start; }
@media (min-width: 720px) {
  .upload-row:has(.preview-box:not([hidden])) { grid-template-columns: 1fr minmax(180px, 220px); }
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: var(--space-6) var(--space-5);
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-strong);
  background: var(--paper);
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand-400); background: var(--brand-050); }
.dropzone.is-dragging { border-color: var(--brand-600); background: var(--brand-100); }
.dropzone.has-file { border-style: solid; border-color: var(--brand-400); background: var(--brand-050); }
.upload-row.has-error .dropzone { border-color: #E4A2A0; background: #FEF1F1; }
.upload-row.has-error .dz-icon { color: #B3261E; }

.dz-icon { width: 32px; height: 32px; color: var(--brand-600); margin-inline: auto; }
.dz-title { margin-top: var(--space-3); font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.dz-sub { margin-top: var(--space-1); font-size: var(--fs-xs); color: var(--ink-muted); }

.preview-box {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.preview-box[hidden] { display: none; }
#preview {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.preview-name { font-size: var(--fs-xs); color: var(--ink-muted); text-align: center; word-break: break-all; direction: ltr; }
.ghost-btn {
  padding: .45rem 1rem;
  font-size: var(--fs-xs);
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid #E4A2A0;
  background: #FEF1F1;
  color: #8C2F2F;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease);
}
.ghost-btn:hover { background: #F3C9C9; }

.submit-area { margin-top: var(--space-6); text-align: center; }
.form-alert {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  background: #FEF1F1;
  border: 1px solid #F3C9C9;
  color: #8C2F2F;
  font-size: var(--fs-sm);
}
.form-alert[hidden] { display: none; }

.submit-btn {
  position: relative;
  width: 100%;
  padding: 1.05rem 1.75rem;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-2);
  transition: transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.submit-btn:hover { transform: translateY(-2px); background: linear-gradient(135deg, var(--grad-from-hover), var(--grad-to-hover)); box-shadow: var(--shadow-3); }
.submit-btn:active { transform: translateY(0); }
.submit-btn[disabled] { cursor: progress; opacity: .85; transform: none; }

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-inline-start: var(--space-2);
  vertical-align: -3px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: register-spin .7s linear infinite;
}
.submit-btn.is-loading .spinner { display: inline-block; }
@keyframes register-spin { to { transform: rotate(360deg); } }

.fineprint { margin-top: var(--space-4); font-size: var(--fs-xs); color: var(--ink-muted); }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .calendar { inset-inline-start: 50%; transform: translateX(-50%); }
  .panel { padding: var(--space-5); }
}
