/**
 * Tema corporate — Gestionale commesse / cantieri edilizia
 * Layout ampio, look istituzionale, meno consumer.
 */

:root {
  --gc-bg: #f8fafc;
  --gc-surface: #ffffff;
  --gc-ink: #0f172a;
  --gc-muted: #475569;
  --gc-line: #e2e8f0;
  --gc-primary: #1e40af;
  --gc-primary-hover: #1e3a8a;
  --gc-accent: #eff6ff;
  --gc-accent-warm: #b45309;
  --gc-navy: #0f172a;
  --gc-container: 1440px;
  --gc-radius: 6px;
  --gc-radius-lg: 10px;
}

html { scroll-behavior: smooth; }

body.gc-corporate {
  background: var(--gc-bg);
  color: var(--gc-ink);
  -webkit-font-smoothing: antialiased;
}

/* Container largo */
.gc-wrap {
  width: 100%;
  max-width: var(--gc-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  padding-right: clamp(1.25rem, 3vw, 2.5rem);
}

.gc-wrap--narrow {
  max-width: 1120px;
}

/* Header sticky: top strip + nav insieme */
.gc-header-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
}

.gc-header-sticky.is-scrolled .gc-header {
  box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.1);
}

/* Top strip — stile FiscoDirect (chiaro, sotto logo) */
.gc-topstrip {
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.85) 0%, #ffffff 50%, rgba(239, 246, 255, 0.85) 100%);
  color: var(--gc-muted);
  font-size: 0.8125rem;
  border-bottom: 1px solid var(--gc-line);
}

.gc-topstrip a {
  color: var(--gc-ink);
  font-weight: 600;
  transition: color 0.15s;
}
.gc-topstrip a:hover { color: var(--gc-primary); }

.gc-topstrip .gc-topstrip-highlight {
  color: var(--gc-ink);
  font-weight: 600;
}

/* Header corporate */
.gc-header {
  background: #fff;
  border-bottom: 1px solid var(--gc-line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.gc-logo-img {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 0.5rem;
}

.gc-logo-img--footer {
  width: 2.25rem;
  height: 2.25rem;
}

.gc-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--gc-radius);
  background: linear-gradient(145deg, var(--gc-primary), #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.gc-logo-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.gc-logo-text span { color: var(--gc-primary); }

/* Pulsanti: rettangolari, non pill */
.gc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--gc-radius);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.gc-btn--primary {
  background: var(--gc-primary);
  color: #fff;
  border: 1px solid var(--gc-primary);
}
.gc-btn--primary:hover {
  background: var(--gc-primary-hover);
  border-color: var(--gc-primary-hover);
}

.gc-btn--outline {
  background: #fff;
  color: var(--gc-ink);
  border: 1px solid var(--gc-line);
}
.gc-btn--outline:hover {
  border-color: var(--gc-primary);
  color: var(--gc-primary);
  background: var(--gc-accent);
}

.gc-btn--ghost {
  background: transparent;
  color: var(--gc-muted);
  border: 1px solid transparent;
}
.gc-btn--ghost:hover {
  color: var(--gc-ink);
  background: var(--gc-accent);
}

.gc-cta-enter-icon {
  display: block;
  flex-shrink: 0;
  width: 1.125em;
  height: 1.125em;
}

.gc-cta-enter-icon--sm {
  width: 1.125rem;
  height: 1.125rem;
}

/* Hero */
.gc-hero {
  background: linear-gradient(180deg, #fff 0%, var(--gc-bg) 100%);
  border-bottom: 1px solid var(--gc-line);
}

.gc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gc-primary);
  background: var(--gc-accent);
  border: 1px solid var(--gc-line);
  padding: 0.375rem 0.75rem;
  border-radius: var(--gc-radius);
}

/* Dashboard mockup */
.gc-mockup {
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-lg);
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 24px 48px -16px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.gc-mockup-bar {
  background: #f1f5f9;
  border-bottom: 1px solid var(--gc-line);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.gc-mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.gc-mockup-sidebar {
  background: var(--gc-navy);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.6875rem;
  padding: 0.75rem 0.5rem;
}

.gc-mockup-sidebar .active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: var(--gc-radius);
  font-weight: 600;
}

.gc-mockup-kpi {
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius);
  padding: 0.625rem 0.75rem;
  background: #fff;
}

.gc-mockup-kpi .label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gc-muted);
  font-weight: 600;
}

.gc-mockup-kpi .value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gc-ink);
  margin-top: 0.125rem;
}

.gc-mockup-kpi .value--ok { color: #15803d; }
.gc-mockup-kpi .value--warn { color: var(--gc-accent-warm); }

/* Sezioni */
.gc-section {
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.gc-section--alt {
  background: #fff;
  border-top: 1px solid var(--gc-line);
  border-bottom: 1px solid var(--gc-line);
}

.gc-section-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--gc-ink);
}

.gc-section-lead {
  max-width: 42rem;
  color: var(--gc-muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  margin-top: 0.75rem;
}

.gc-seo-prose strong {
  font-weight: 600;
  color: var(--gc-ink);
}

details.gc-card summary::-webkit-details-marker { display: none; }

/* Card corporate */
.gc-card {
  background: #fff;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-lg);
  padding: 1.5rem;
  height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gc-card:hover {
  border-color: #b8c5d4;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.gc-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--gc-radius);
  background: var(--gc-accent);
  color: var(--gc-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.gc-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gc-ink);
  margin-bottom: 0.5rem;
}

.gc-card p {
  font-size: 0.875rem;
  color: var(--gc-muted);
  line-height: 1.6;
}

/* Flussi operativi — sezione larga a tutta banda */
.gc-section--flows {
  background: linear-gradient(180deg, var(--gc-accent) 0%, var(--gc-bg) 100%);
  border-top: 1px solid var(--gc-line);
  border-bottom: 1px solid var(--gc-line);
  padding-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.gc-section--flows .gc-section-lead {
  max-width: 52rem;
}

.gc-flow-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 768px) {
  .gc-flow-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1280px) {
  .gc-flow-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
  }
}

.gc-flow-card {
  background: #fff;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-lg);
  padding: 1.75rem 1.5rem;
  height: 100%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 24px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  position: relative;
}

.gc-flow-card:hover {
  border-color: rgba(30, 64, 175, 0.35);
  box-shadow: 0 8px 32px -8px rgba(30, 64, 175, 0.12);
}

.gc-flow-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--gc-radius);
  background: var(--gc-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.gc-flow-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gc-ink);
  margin-bottom: 0.625rem;
}

.gc-flow-card p {
  font-size: 0.9375rem;
  color: var(--gc-muted);
  line-height: 1.65;
}

@media (min-width: 1280px) {
  .gc-flow-card:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.25rem;
    right: -0.95rem;
    width: 1.25rem;
    height: 2px;
    background: linear-gradient(90deg, var(--gc-primary), rgba(30, 64, 175, 0.2));
    pointer-events: none;
  }
}

/* Flussi: timeline verticale mobile (legacy, non usata) */
.gc-flow-step {
  position: relative;
  padding-left: 2.5rem;
}

.gc-flow-step::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--gc-radius);
  background: var(--gc-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .gc-flow-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  .gc-flow-step {
    padding-left: 0;
    padding-top: 2.75rem;
  }
  .gc-flow-step::before {
    top: 0;
    left: 0;
  }
}

/* Tabella moduli */
.gc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.gc-table th,
.gc-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gc-line);
}

.gc-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--gc-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gc-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--gc-radius);
  background: var(--gc-accent);
  color: var(--gc-primary);
  border: 1px solid var(--gc-line);
}

.gc-badge--v2 {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

/* Footer */
.gc-footer {
  background: #0b0d10;
  color: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gc-footer a {
  color: rgba(255, 255, 255, 0.88);
  transition: color 0.15s;
}
.gc-footer a:hover { color: #fff; }

.gc-footer .gc-logo-text,
.gc-footer .gc-logo-text span {
  color: #fff;
}

.gc-footer h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 0.75rem;
}

/* Motion leggero */
@media (prefers-reduced-motion: no-preference) {
  .gc-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .gc-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gc-reveal { opacity: 1; transform: none; }
}

/* Rassegna stampa — come FiscoDirect */
.press-logo {
  max-height: 26px;
  width: auto;
  opacity: 1;
  transition: opacity 0.2s;
}
@media (min-width: 768px) {
  .press-logo { max-height: 28px; }
}
.press-logo:hover { opacity: 0.88; }

.partner-logo {
  max-height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  opacity: 0.85;
}

.gc-press-marquee-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 6px 0 10px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.gc-press-marquee-track {
  display: flex;
  align-items: center;
  gap: 2.75rem;
  width: max-content;
  animation: gcPressMarquee 22s linear infinite;
  will-change: transform;
}

.gc-press-marquee-track img {
  max-height: 26px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.95;
}

@keyframes gcPressMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .gc-press-marquee-track { animation: none !important; }
}

/* Modal demo */
.gc-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gc-modal.is-open {
  display: flex;
}

.gc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.gc-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--gc-line);
  border-radius: var(--gc-radius-lg);
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.2);
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .gc-modal__dialog {
    max-width: 32rem;
    padding: 1.75rem;
  }
}

.gc-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--gc-muted);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--gc-radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.gc-modal__close:hover {
  background: var(--gc-accent);
  color: var(--gc-ink);
}

.gc-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gc-ink);
  padding-right: 2rem;
}

.gc-modal__lead {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--gc-muted);
  line-height: 1.55;
}

body.gc-modal-open {
  overflow: hidden;
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .gc-press-static-row {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem 2rem;
  }
}

/* WhatsApp floating (come fiscodirect.it) */
#gc-wa-float {
  padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
}

#gc-wa-bubble {
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(30, 64, 175, 0.08);
  animation: gc-wa-bubble-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes gc-wa-bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #gc-wa-bubble { animation: none; opacity: 1; transform: none; }
}

#gc-wa-bubble.gc-wa-bubble--dismissed {
  display: none !important;
}

.gc-wa-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: gc-wa-pulse-ring 2.2s ease-out infinite;
}

@keyframes gc-wa-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gc-wa-pulse-dot { animation: none; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }
}

#gc-wa-fab {
  position: relative;
  background: linear-gradient(145deg, #2fe06d, #25d366);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45), 0 2px 4px rgba(15, 23, 42, 0.08);
}

#gc-wa-fab:active { transform: scale(0.96); }

.gc-wa-fab-online-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 1;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: gc-wa-pulse-ring 2.2s ease-out infinite;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .gc-wa-fab-online-dot {
    animation: none;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  }
}
