@font-face {
  font-family: "Akko Pro";
  src: url("../fonts/AkkoPro-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Akko Pro";
  src: url("../fonts/Akko-Pro-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Akko Pro";
  src: url("../fonts/Akko-Pro-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --alp-bg: #f7f9f8;
  --alp-white: #ffffff;
  --alp-primary: #00547a;
  --alp-secondary: #1d7990;
  --alp-secondary-tint: #d6edf4;
  --alp-accent: #db3700;
  --alp-accent-tint: #fdeee9;
  --alp-body: #333e48;
  --alp-border: #dadfe4;
  --alp-disabled: #dadfe4;
  --alp-hint: #778998;
  --alp-muted: #b4c6d4;
  --alp-shadow-input: 0px 1px 4px rgba(12, 12, 13, 0.10), 0px 1px 4px rgba(12, 12, 13, 0.05);
}

.alp-form-ap-wrapper,
.alp-form-ap-wrapper * {
  box-sizing: border-box;
}

.alp-form-ap-wrapper [hidden] {
  display: none !important;
}

.alp-form-ap-wrapper {
  margin: 0 auto;
  padding: 20px 16px 80px;
  background-color: var(--alp-bg);
  color: var(--alp-body);
  font-family: "Akko Pro", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.3;
}

.alp-page-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0 24px;
}

.alp-page-title {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 130%;
  color: var(--alp-primary);
}

.alp-page-subtitle {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 140%;
  color: var(--alp-body);
}

@media screen and (min-width: 768px) {
  .alp-page-title { font-size: 36px; }
  .alp-page-subtitle { font-size: 22px; }
}

.alp-card-box {
  background-color: var(--alp-white);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.alp-required-note {
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  color: var(--alp-accent);
  text-align: right;
}

.alp-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.alp-section:not(:last-child) {
  border-bottom: 0.5px solid var(--alp-border);
  padding-bottom: 20px;
}

.alp-form-ap-wrapper fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.alp-section-title {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  line-height: 130%;
  color: var(--alp-primary);
}

.alp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alp-field-label {
  font-size: 16px;
  font-weight: 500;
  line-height: 130%;
  color: var(--alp-body);
}

.alp-field-label .req,
.alp-form-ap-wrapper legend .req {
  color: var(--alp-accent);
  font-weight: 400;
}

.alp-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  line-height: 130%;
  color: var(--alp-body);
  background-color: var(--alp-white);
  border: 1px solid var(--alp-border);
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: var(--alp-shadow-input);
}

.alp-input::placeholder { color: var(--alp-muted); font-weight: 300; }

textarea.alp-input {
  min-height: 120px;
  resize: vertical;
}

select.alp-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' stroke='%23778998' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.alp-input:focus-visible {
  outline: 2px solid var(--alp-secondary);
  outline-offset: 0;
}

.alp-input[aria-invalid="true"] {
  border-color: var(--alp-accent);
}

.alp-error-msg {
  display: block;
  font-size: 13px;
  color: var(--alp-accent);
}

.alp-hint {
  display: block;
  font-size: 12px;
  font-weight: 300;
  color: var(--alp-hint);
}

/* Combobox (Provincia / Argomento): select nativo sostituito da input +
   listbox per renderlo searchable, restando conforme al pattern ARIA
   combobox-listbox (WAI-ARIA APG). */
.alp-combobox {
  position: relative;
}

.alp-combobox-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' stroke='%23778998' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.alp-combobox-input:disabled {
  background-color: var(--alp-bg);
  color: var(--alp-hint);
  cursor: not-allowed;
}

.alp-combobox-listbox {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  background-color: var(--alp-white);
  border: 1px solid var(--alp-border);
  border-radius: 8px;
  box-shadow: var(--alp-shadow-input);
}

.alp-combobox-option {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 300;
  line-height: 130%;
  cursor: pointer;
}

.alp-combobox-option.is-active {
  background-color: var(--alp-secondary-tint);
}

.alp-combobox-option.is-selected {
  font-weight: 500;
  color: var(--alp-secondary);
}

.alp-combobox-empty {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--alp-hint);
}

/* Card-style radio groups */
.alp-card-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.alp-card-item { flex: 1 1 140px; }

.alp-card-item input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.alp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  min-height: 80px;
  border-radius: 12px;
  border: 1px solid var(--alp-border);
  background-color: var(--alp-white);
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.alp-form-ap-wrapper input[type="radio"]:checked + .alp-card {
  background-color: var(--alp-secondary-tint);
  border-color: transparent;
}

.alp-form-ap-wrapper input[type="radio"]:focus-visible + .alp-card {
  outline: 3px solid var(--alp-secondary);
  outline-offset: 2px;
}

.alp-card-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--alp-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alp-form-ap-wrapper input[type="radio"]:checked + .alp-card .alp-card-dot {
  border-color: var(--alp-secondary);
}

.alp-card-dot::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: transparent;
}

.alp-form-ap-wrapper input[type="radio"]:checked + .alp-card .alp-card-dot::after {
  background-color: var(--alp-secondary);
}

.alp-card-label {
  font-size: 16px;
  font-weight: 700;
  line-height: 130%;
  color: var(--alp-secondary);
}

@media screen and (max-width: 480px) {
  .alp-card-item { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .alp-form-ap-wrapper * { transition: none !important; animation: none !important; }
}

/* Checkbox (privacy) */
.alp-checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.alp-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--alp-secondary);
  cursor: pointer;
}

.alp-checkbox-field input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--alp-secondary);
  outline-offset: 2px;
}

.alp-checkbox-text {
  font-size: 14px;
  font-weight: 300;
  line-height: 130%;
  color: var(--alp-body);
}

.alp-checkbox-text a {
  color: var(--alp-secondary);
  font-weight: 500;
  text-decoration: underline;
}

/* Attachment */
.alp-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background-color: var(--alp-white);
  border: 1px dashed var(--alp-border);
  border-radius: 8px;
  color: var(--alp-secondary);
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.alp-attach-btn:hover { background-color: #f5f6f7; }

.alp-attachments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alp-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background-color: var(--alp-white);
  border: 1px solid var(--alp-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}

.alp-attachment-remove {
  background: none;
  border: 0;
  color: var(--alp-hint);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
}

.alp-attachment-remove:hover { color: var(--alp-accent); }

/* Submit button */
.alp-btn-submit {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: var(--alp-white);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  background-color: var(--alp-disabled);
  cursor: not-allowed;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.alp-btn-submit:not(:disabled) {
  background-color: var(--alp-secondary);
  cursor: pointer;
}

.alp-btn-submit:not(:disabled):hover { opacity: 0.9; }
.alp-btn-submit:not(:disabled):active { opacity: 0.8; }

.alp-btn-submit:focus-visible {
  outline: 3px solid var(--alp-primary);
  outline-offset: 2px;
}

/* Error summary */
.alp-error-summary {
  display: none;
  border: 1px solid var(--alp-accent);
  background-color: var(--alp-accent-tint);
  border-radius: 8px;
  padding: 16px;
}

.alp-error-summary.is-visible { display: block; }

.alp-error-summary h2 {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--alp-accent);
}

.alp-error-summary ul { margin: 0; padding-left: 20px; }

.alp-error-summary a {
  color: var(--alp-accent);
  font-weight: 500;
}

/* Success panel */
.alp-success-panel { text-align: center; padding: 40px 16px; }

.alp-success-panel .alp-success-icon {
  font-size: 48px;
  color: var(--alp-secondary);
}

.alp-success-panel h2 {
  color: var(--alp-primary);
  font-size: 22px;
  font-weight: 500;
  margin: 12px 0 8px;
}

/* Config status */
.alp-config-status {
  font-size: 14px;
  font-weight: 300;
  color: var(--alp-hint);
  text-align: center;
}

.alp-config-status.is-error { color: var(--alp-accent); }

.alp-retry-btn {
  display: inline-block;
  margin-top: 8px;
  background: none;
  border: 1px solid var(--alp-border);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--alp-body);
}

.alp-char-counter {
  display: block;
  text-align: right;
  font-size: 12px;
  font-weight: 300;
  color: var(--alp-hint);
}

.alp-form-ap-wrapper .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
