/* HAWICA — Registrazione pubblica (wizard) */
/* Token: primary #1D4ED8, Oswald headings, Roboto body */

:root {
  --hw-primary: #1D4ED8;
  --hw-primary-dark: #1e40af;
  --hw-text: #111827;
  --hw-muted: #6b7280;
  --hw-border: #e5e7eb;
  --hw-bg: #f9fafb;
  --hw-error: #b91c1c;
  --hw-success: #15803d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif;
  color: var(--hw-text);
  background: var(--hw-bg);
}

h1, h2, h3, legend {
  font-family: 'Oswald', 'Roboto Condensed', sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hw-header {
  background: #ffffff;
  border-bottom: 1px solid var(--hw-border);
  padding: 14px 24px;
}

.hw-header a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--hw-text); }
.hw-header img { height: 40px; width: auto; }

.hw-container {
  max-width: 720px;
  margin: 32px auto 64px;
  padding: 0 16px;
}

.hw-card {
  background: #ffffff;
  border: 1px solid var(--hw-border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
}

.hw-title { margin: 0 0 4px; font-size: 28px; }
.hw-subtitle { margin: 0 0 24px; color: var(--hw-muted); font-size: 15px; }

/* Progress */
.hw-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.hw-progress span {
  flex: 1; height: 6px; border-radius: 3px; background: var(--hw-border);
}
.hw-progress span.active { background: var(--hw-primary); }

.hw-step-label { font-size: 13px; color: var(--hw-muted); margin-bottom: 18px; text-transform: uppercase; letter-spacing: 0.06em; }

/* Form */
.hw-field { margin-bottom: 18px; }
.hw-field label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.hw-field input[type="text"],
.hw-field input[type="email"],
.hw-field input[type="password"],
.hw-field input[type="tel"] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--hw-border);
  border-radius: 8px; font-size: 15px; font-family: inherit;
}
.hw-field select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--hw-border);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff;
}
.hw-field input:focus, .hw-field select:focus { outline: 2px solid var(--hw-primary); outline-offset: 0; border-color: var(--hw-primary); }
.hw-field .hw-hint { font-size: 12.5px; color: var(--hw-muted); margin-top: 5px; }
.hw-field.invalid input { border-color: var(--hw-error); }
.hw-field .hw-field-error { display: none; color: var(--hw-error); font-size: 12.5px; margin-top: 5px; }
.hw-field.invalid .hw-field-error { display: block; }

.hw-row { display: flex; gap: 14px; }
.hw-row .hw-field { flex: 1; }

/* Password show/hide */
.hw-password-wrap { position: relative; }
.hw-password-wrap input[type="password"],
.hw-password-wrap input[type="text"] { padding-right: 44px; }
.hw-password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--hw-muted); border-radius: 6px;
}
.hw-password-toggle:hover { color: var(--hw-text); background: var(--hw-bg); }
.hw-password-toggle:focus-visible { outline: 2px solid var(--hw-primary); outline-offset: 1px; }
.hw-password-toggle .hidden { display: none; }

/* Radio cards (modalità di lavoro) */
.hw-choice {
  display: block; border: 1px solid var(--hw-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; cursor: pointer;
}
.hw-choice input { margin-right: 10px; accent-color: var(--hw-primary); }
.hw-choice.selected { border-color: var(--hw-primary); background: #eff6ff; }
.hw-choice strong { display: inline; font-size: 15px; }
.hw-choice p { margin: 6px 0 0 26px; font-size: 13.5px; color: var(--hw-muted); }

.hw-checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin: 16px 0; }
.hw-checkbox input { margin-top: 3px; accent-color: var(--hw-primary); }

/* Repeatable blocks (sedi / team) */
.hw-block {
  border: 1px solid var(--hw-border); border-radius: 10px;
  padding: 18px; margin-bottom: 14px; position: relative;
}
.hw-block h3 { margin: 0 0 14px; font-size: 16px; }
.hw-block .hw-remove {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  color: var(--hw-muted); cursor: pointer; font-size: 13px; text-decoration: underline;
}

/* Buttons */
.hw-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.hw-btn {
  display: inline-block; padding: 12px 28px; border-radius: 8px; font-size: 15px;
  font-weight: 600; cursor: pointer; border: none; font-family: inherit;
}
.hw-btn-primary { background: var(--hw-primary); color: #fff; }
.hw-btn-primary:hover { background: var(--hw-primary-dark); }
.hw-btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.hw-btn-secondary { background: #fff; color: var(--hw-text); border: 1px solid var(--hw-border); }
.hw-btn-link { background: none; border: none; color: var(--hw-primary); cursor: pointer; font-size: 14px; text-decoration: underline; padding: 0; }

/* Summary */
.hw-summary dl { margin: 0; }
.hw-summary dt { font-size: 12.5px; color: var(--hw-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 14px; }
.hw-summary dd { margin: 3px 0 0; font-size: 15px; }

/* Alerts */
.hw-alert { border-radius: 8px; padding: 14px 16px; font-size: 14px; margin-bottom: 18px; display: none; }
.hw-alert.show { display: block; }
.hw-alert-error { background: #fef2f2; color: var(--hw-error); border: 1px solid #fecaca; }
.hw-alert-success { background: #f0fdf4; color: var(--hw-success); border: 1px solid #bbf7d0; }

/* Final screen */
.hw-final { text-align: center; padding: 24px 8px; }
.hw-final .hw-final-icon { font-size: 48px; margin-bottom: 8px; }
.hw-final h2 { font-size: 24px; margin: 0 0 10px; }
.hw-final p { color: var(--hw-muted); font-size: 15px; }

.hidden { display: none !important; }

/* Honeypot anti-bot: fuori viewport, mai display:none (alcuni bot lo saltano) */
.hw-hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }

/* Captcha anti-bot (proof-of-work self-hosted) */
.hw-captcha { border: 1px solid var(--hw-border); border-radius: 8px; padding: 12px 14px; background: var(--hw-bg); }
.hw-captcha .hw-hint { margin: 0 0 8px; }
.hw-captcha-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--hw-muted); }
.hw-captcha-status[data-state="done"] { color: var(--hw-success); }
.hw-captcha-status[data-state="error"] { color: var(--hw-error); }
.hw-captcha-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--hw-border); border-top-color: var(--hw-primary);
  animation: hw-spin 0.7s linear infinite;
}
.hw-captcha-status[data-state="done"] .hw-captcha-spinner { display: none; }
.hw-captcha-status[data-state="error"] .hw-captcha-spinner { display: none; }
@keyframes hw-spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .hw-card { padding: 22px 16px; }
  .hw-row { flex-direction: column; gap: 0; }
  .hw-actions { flex-direction: column-reverse; }
  .hw-btn { width: 100%; }
}
