/* ===== Tekto Support — base styles ===== */
:root {
  --blue: #1a4a80;
  --blue-dark: #143a66;
  --orange: #f97316;
  --orange-dark: #ea620a;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --green: #16a34a;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius-card: 16px;
  --radius-field: 12px;
  --maxw: 760px;
  /* card accents */
  --c-blue: #3b82f6;
  --c-purple: #8b5cf6;
  --c-green: #10b981;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(160deg, #f0f5ff 0%, #f8fafc 60%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Header ===== */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border), 0 4px 16px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--orange);
  padding-left: 10px;
}

.brand img {
  height: 36px;
  width: auto;
  display: block;
}

.brand .label {
  background: rgba(26, 74, 128, 0.08);
  color: var(--blue);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand:hover {
  text-decoration: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 20px;
  border-radius: var(--radius-field);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-orange {
  background: var(--orange);
  color: #fff;
}

.btn-orange:hover {
  background: var(--orange-dark);
}

/* Outlined blue — secondary action */
.btn-blue {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  padding: 10px 19px;
}

.btn-blue:hover {
  background: var(--blue);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: #f1f5f9;
}

.btn-pill {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.9rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ===== Footer ===== */
.site-footer {
  border-top: none;
  background: linear-gradient(to bottom, transparent, rgba(26, 74, 128, 0.03));
  margin-top: 72px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--blue);
  font-weight: 600;
}

/* ===== Hero ===== */
.hero {
  text-align: left;
  padding: 72px 0 48px;
}

/* Orange section-marker bar above headings */
.hero h1::before,
.docs h2::before,
.page-head h1::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: var(--orange);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  color: var(--blue);
  line-height: 1.1;
}

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 520px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* ===== Quick cards ===== */
.quick-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 64px;
}

.quick-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--muted);
  border-radius: 0 0 16px 16px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}

.quick-card .ico {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.quick-card h3 {
  margin: 10px 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.quick-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.quick-card .more {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Card 1 — Presenze (blue) */
.quick-card:nth-child(1) {
  border-top-color: var(--c-blue);
}
.quick-card:nth-child(1) .ico {
  background: rgba(59, 130, 246, 0.08);
}
.quick-card:nth-child(1) .more {
  color: var(--c-blue);
}
.quick-card:nth-child(1):hover {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Card 2 — Magazzino (purple) */
.quick-card:nth-child(2) {
  border-top-color: var(--c-purple);
}
.quick-card:nth-child(2) .ico {
  background: rgba(139, 92, 246, 0.08);
}
.quick-card:nth-child(2) .more {
  color: var(--c-purple);
}
.quick-card:nth-child(2):hover {
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Card 3 — Contabilità (green) */
.quick-card:nth-child(3) {
  border-top-color: var(--c-green);
}
.quick-card:nth-child(3) .ico {
  background: rgba(16, 185, 129, 0.08);
}
.quick-card:nth-child(3) .more {
  color: var(--c-green);
}
.quick-card:nth-child(3):hover {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.quick-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
}

/* ===== Docs ===== */
.docs h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--blue);
}

.docs .docs-sub {
  color: var(--muted);
  margin: 0 0 24px;
}

details.doc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
  scroll-margin-top: 80px;
}

details.doc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  padding-left: 20px;
  border-left: 3px solid var(--blue);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  user-select: none;
  transition: border-color 0.2s, background 0.15s;
}

details.doc[open] > summary {
  border-left-color: var(--orange);
  border-bottom: 1px solid var(--border);
}

details.doc > summary::-webkit-details-marker {
  display: none;
}

details.doc > summary .ico {
  font-size: 1.1rem;
  opacity: 0.55;
  transition: opacity 0.15s;
}

details.doc[open] > summary .ico {
  opacity: 1;
}

details.doc > summary .chev {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s;
  font-size: 1rem;
}

details.doc[open] > summary .chev {
  transform: rotate(180deg);
}

.doc-body {
  padding: 18px 20px 22px;
  padding-left: 24px;
  color: #1e293b;
}

.doc-body p {
  margin: 0 0 12px;
}

.doc-body p:last-child {
  margin-bottom: 0;
}

.doc-body ul {
  margin: 0 0 12px;
  padding-left: 0;
}

.doc-body li {
  list-style: none;
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}

.doc-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.4;
}

.doc-body strong {
  color: var(--text);
}

.doc-body h4 {
  margin: 18px 0 8px;
  font-size: 0.9rem;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.doc-body a {
  color: var(--blue);
  text-decoration: none;
}

.doc-body a:hover {
  text-decoration: underline;
}

.faq-q {
  background: rgba(26, 74, 128, 0.04);
  border-left: 3px solid var(--blue);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
}

.faq-q:first-child {
  margin-top: 0;
}

/* ===== Forms ===== */
.page {
  padding: 48px 0 16px;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 0 16px 48px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
}

.page-head {
  text-align: left;
  margin-bottom: 28px;
}

.page-head h1 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--blue);
}

.page-head p {
  color: var(--muted);
  margin: 0;
}

.field {
  margin-bottom: 20px;
}

.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.field .hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: -2px;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.97rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 11px 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 74, 128, 0.15);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: #dc2626;
}

.error-msg {
  display: none;
  color: #dc2626;
  font-size: 0.83rem;
  margin-top: 5px;
}

.field.has-error .error-msg {
  display: block;
}

/* Priority pill toggles */
.priority-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.priority-opt {
  position: relative;
}

.priority-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.priority-opt label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 12px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  height: 100%;
}

.priority-opt label .p-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.priority-opt label .p-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.priority-opt input:checked + label {
  border-color: var(--blue);
  background: rgba(26, 74, 128, 0.06);
  box-shadow: 0 0 0 3px rgba(26, 74, 128, 0.15);
}

.priority-opt input:focus-visible + label {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.form-error-box {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius-field);
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.form-error-box.show {
  display: block;
}

/* Submit button */
#submitBtn {
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Submit spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ===== Success page ===== */
.success-wrap {
  text-align: center;
  padding: 56px 0 16px;
  max-width: 540px;
  margin: 0 auto;
}

.check-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: check-in 0.4s ease-out 1;
}

@keyframes check-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.check-circle .check {
  width: 32px;
  height: 60px;
  border: solid var(--green);
  border-width: 0 7px 7px 0;
  transform: rotate(45deg);
  margin-top: -8px;
  border-radius: 2px;
}

.success-wrap h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 0 14px;
  color: var(--blue);
}

.success-wrap p {
  color: var(--muted);
  margin: 0 0 12px;
}

.success-wrap .email-strong {
  color: var(--text);
  font-weight: 600;
}

.success-wrap .actions {
  margin-top: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero {
    padding: 48px 0 36px;
  }

  .hero p {
    font-size: 1rem;
  }

  .quick-cards {
    grid-template-columns: 1fr;
  }

  .priority-group {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 24px 18px;
  }

  .site-header .inner {
    padding: 12px 16px;
  }
}
