/* ==========================================================================
   ASSICOMUNALE — Design System CSS
   Version: 3.0.0 — Enterprise Premium
   Prefix: ac-
   Stack: GeneratePress + GenerateBlocks Pro
   Reference: prima.it (fintech/insurtech corporate)

   TABLE OF CONTENTS
   1. Design Tokens (Custom Properties)
   2. CSS Reset & Base
   3. Typography System
   4. Link & Focus Styles
   5. Container & Layout
   6. Section System
   7. Button System
   8. Form Elements
   9. Card System
   10. Badge & Tag
   11. Utility Classes
   12. Accessibility
   13. Print Styles
   14. Reduced Motion
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
  /* ---- Color: Primary (Prima Assicurazioni Teal) ---- */
  --ac-primary-50:  #E6F7FA;
  --ac-primary-100: #CCF0F5;
  --ac-primary-200: #99E0EB;
  --ac-primary-300: #4DC5D8;
  --ac-primary-400: #1A9DB5;
  --ac-primary-500: #00748B;    /* main brand */
  --ac-primary-600: #005F72;
  --ac-primary-700: #005A6B;    /* hover/active */
  --ac-primary-800: #003D4A;
  --ac-primary-900: #002933;

  /* Shorthand aliases */
  --ac-primary:       var(--ac-primary-500);
  --ac-primary-dark:  var(--ac-primary-700);
  --ac-primary-light: var(--ac-primary-50);
  --ac-primary-rgb:   0,116,139;

  /* ---- Color: Accent (Prima Rosso/Gradient) ---- */
  --ac-accent-50:  #FDE8EF;
  --ac-accent-100: #FBD1DF;
  --ac-accent-200: #F7A3BF;
  --ac-accent-300: #EB5A8A;
  --ac-accent-400: #E33870;
  --ac-accent-500: #DF1654;    /* main accent / CTA */
  --ac-accent-600: #C41248;
  --ac-accent-700: #A00E3B;
  --ac-accent-800: #7C0A2E;
  --ac-accent-900: #580721;

  --ac-accent:       var(--ac-accent-500);
  --ac-accent-hover: var(--ac-accent-600);

  /* ---- Color: Secondary (Prima Viola) ---- */
  --ac-secondary-500: #8334C2;
  --ac-secondary-600: #6B2AA0;
  --ac-secondary-700: #531F7E;

  /* ---- Gradients ---- */
  --ac-gradient:           linear-gradient(135deg, #DF1654 0%, #8334C2 100%);
  --ac-gradient-reverse:   linear-gradient(135deg, #8334C2 0%, #DF1654 100%);
  --ac-gradient-primary:   linear-gradient(135deg, #00748B 0%, #005A6B 100%);
  --ac-gradient-hero:      linear-gradient(135deg, rgba(0,116,139,0.90) 0%, rgba(26,26,46,0.85) 100%);
  --ac-gradient-dark:      linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
  --ac-gradient-subtle:    linear-gradient(180deg, #f7fafc 0%, #ffffff 100%);

  /* ---- Color: Neutral ---- */
  --ac-neutral-0:   #ffffff;
  --ac-neutral-50:  #f7fafc;
  --ac-neutral-100: #edf2f7;
  --ac-neutral-200: #e2e8f0;
  --ac-neutral-300: #cbd5e0;
  --ac-neutral-400: #a0aec0;
  --ac-neutral-500: #718096;
  --ac-neutral-600: #4a5568;
  --ac-neutral-700: #2d3748;
  --ac-neutral-800: #1a202c;
  --ac-neutral-900: #171923;

  /* Semantic neutral aliases */
  --ac-dark:   #1a1a2e;
  --ac-body:   var(--ac-neutral-600);
  --ac-muted:  var(--ac-neutral-500);
  --ac-border: var(--ac-neutral-200);
  --ac-bg:     var(--ac-neutral-0);
  --ac-bg-alt: var(--ac-neutral-50);

  /* ---- Color: Semantic ---- */
  --ac-success-500: #38A169;
  --ac-success-50:  #F0FFF4;
  --ac-warning-500: #D69E2E;
  --ac-warning-50:  #FFFFF0;
  --ac-error-500:   #E53E3E;
  --ac-error-50:    #FFF5F5;
  --ac-info-500:    #3182CE;
  --ac-info-50:     #EBF8FF;

  /* Stars / ratings */
  --ac-star: #F6AD55;

  /* ---- Typography ---- */
  --ac-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --ac-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Font sizes — modular scale 1.25 (Major Third) */
  --ac-text-xs:   0.75rem;     /* 12px */
  --ac-text-sm:   0.875rem;    /* 14px */
  --ac-text-base: 1.0625rem;   /* 17px */
  --ac-text-lg:   1.125rem;    /* 18px */
  --ac-text-xl:   1.25rem;     /* 20px */
  --ac-text-2xl:  1.5rem;      /* 24px */
  --ac-text-3xl:  1.875rem;    /* 30px */
  --ac-text-4xl:  2.25rem;     /* 36px */
  --ac-text-5xl:  3rem;        /* 48px */
  --ac-text-6xl:  3.75rem;     /* 60px */

  /* Fluid headings */
  --ac-h1: clamp(2.25rem, 3.5vw + 1rem, 3.5rem);    /* 36-56px */
  --ac-h2: clamp(1.75rem, 2.5vw + 0.75rem, 2.5rem);  /* 28-40px */
  --ac-h3: clamp(1.25rem, 1.5vw + 0.5rem, 1.75rem);  /* 20-28px */
  --ac-h4: 1.25rem;                                    /* 20px */
  --ac-h5: 1.125rem;                                   /* 18px */
  --ac-h6: 1rem;                                       /* 16px */

  /* Font weights */
  --ac-weight-light:    300;
  --ac-weight-regular:  400;
  --ac-weight-medium:   500;
  --ac-weight-semibold: 600;
  --ac-weight-bold:     700;

  /* Line heights */
  --ac-leading-tight:   1.2;
  --ac-leading-snug:    1.35;
  --ac-leading-normal:  1.5;
  --ac-leading-relaxed: 1.65;
  --ac-leading-loose:   1.8;

  /* Letter spacing */
  --ac-tracking-tighter: -0.03em;
  --ac-tracking-tight:   -0.02em;
  --ac-tracking-normal:  0;
  --ac-tracking-wide:    0.025em;
  --ac-tracking-wider:   0.05em;
  --ac-tracking-widest:  0.1em;

  /* ---- Spacing (4px base) ---- */
  --ac-space-0:  0;
  --ac-space-1:  0.25rem;   /* 4px */
  --ac-space-2:  0.5rem;    /* 8px */
  --ac-space-3:  0.75rem;   /* 12px */
  --ac-space-4:  1rem;      /* 16px */
  --ac-space-5:  1.25rem;   /* 20px */
  --ac-space-6:  1.5rem;    /* 24px */
  --ac-space-8:  2rem;      /* 32px */
  --ac-space-10: 2.5rem;    /* 40px */
  --ac-space-12: 3rem;      /* 48px */
  --ac-space-16: 4rem;      /* 64px */
  --ac-space-20: 5rem;      /* 80px */
  --ac-space-24: 6rem;      /* 96px */
  --ac-space-32: 8rem;      /* 128px */

  /* ---- Layout ---- */
  --ac-container-sm:  640px;
  --ac-container-md:  768px;
  --ac-container-lg:  1024px;
  --ac-container-xl:  1200px;
  --ac-container-2xl: 1400px;
  --ac-container:     var(--ac-container-xl);
  --ac-section-py:    clamp(3.5rem, 8vw, 6rem);
  --ac-gap:           2rem;

  /* ---- Border Radius ---- */
  --ac-radius-none: 0;
  --ac-radius-sm:   4px;
  --ac-radius-md:   8px;
  --ac-radius-lg:   12px;
  --ac-radius-xl:   16px;
  --ac-radius-2xl:  24px;
  --ac-radius-full: 9999px;
  --ac-radius:      var(--ac-radius-lg);

  /* ---- Shadows ---- */
  --ac-shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --ac-shadow-sm:  0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --ac-shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --ac-shadow-lg:  0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --ac-shadow-xl:  0 20px 25px rgba(0,0,0,0.1), 0 8px 10px rgba(0,0,0,0.04);
  --ac-shadow-2xl: 0 25px 50px rgba(0,0,0,0.15);
  /* Card-specific */
  --ac-shadow:       0 4px 24px rgba(0,0,0,0.06);
  --ac-shadow-hover: 0 12px 40px rgba(0,0,0,0.12);
  /* Colored shadows */
  --ac-shadow-primary: 0 4px 14px rgba(0,116,139,0.25);
  --ac-shadow-accent:  0 4px 14px rgba(223,22,84,0.25);

  /* ---- Transitions ---- */
  --ac-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ac-ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ac-ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ac-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --ac-duration-fast:   150ms;
  --ac-duration-base:   300ms;
  --ac-duration-slow:   500ms;
  --ac-duration-slower: 700ms;

  --ac-transition:       var(--ac-duration-base) var(--ac-ease);
  --ac-transition-fast:  var(--ac-duration-fast) var(--ac-ease);
  --ac-transition-slow:  var(--ac-duration-slow) var(--ac-ease);

  /* ---- Z-index ---- */
  --ac-z-base:     0;
  --ac-z-above:    1;
  --ac-z-dropdown: 1000;
  --ac-z-sticky:   1100;
  --ac-z-overlay:  1200;
  --ac-z-modal:    1300;
  --ac-z-popover:  1400;
  --ac-z-tooltip:  1500;

  /* ---- Focus Ring ---- */
  --ac-focus-ring: 0 0 0 3px rgba(0,116,139,0.4);
  --ac-focus-ring-accent: 0 0 0 3px rgba(223,22,84,0.4);
}


/* ==========================================================================
   2. CSS RESET & BASE
   Minimal reset compatible with GeneratePress base styles.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins */
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
}

/* Smooth scrolling only if no preference for reduced motion */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  font-family: var(--ac-font);
  font-size: var(--ac-text-base);
  line-height: var(--ac-leading-relaxed);
  color: var(--ac-body);
  background: var(--ac-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Images */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Remove list styles on ul, ol elements with a list role */
:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Table base */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove all animations and transitions for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ==========================================================================
   3. TYPOGRAPHY SYSTEM
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ac-font);
  color: var(--ac-dark);
  font-weight: var(--ac-weight-bold);
  line-height: var(--ac-leading-tight);
  letter-spacing: var(--ac-tracking-tight);
  margin-bottom: 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: var(--ac-h1);
  letter-spacing: var(--ac-tracking-tighter);
}

h2 {
  font-size: var(--ac-h2);
  margin-bottom: 0.75em;
}

h3 {
  font-size: var(--ac-h3);
}

h4 { font-size: var(--ac-h4); }
h5 { font-size: var(--ac-h5); }
h6 { font-size: var(--ac-h6); font-weight: var(--ac-weight-semibold); }

p {
  margin-bottom: 1em;
  max-width: 75ch; /* Optimal reading width */
}

p:last-child {
  margin-bottom: 0;
}

/* Lead text */
.ac-lead {
  font-size: var(--ac-text-xl);
  line-height: var(--ac-leading-relaxed);
  color: var(--ac-neutral-600);
}

/* Small / caption text */
small,
.ac-small {
  font-size: var(--ac-text-sm);
  line-height: var(--ac-leading-normal);
}

.ac-caption {
  font-size: var(--ac-text-xs);
  color: var(--ac-muted);
  letter-spacing: var(--ac-tracking-wide);
  text-transform: uppercase;
  font-weight: var(--ac-weight-semibold);
}

/* Blockquote */
blockquote {
  border-left: 4px solid var(--ac-primary);
  padding: var(--ac-space-4) var(--ac-space-6);
  margin: var(--ac-space-8) 0;
  background: var(--ac-primary-50);
  border-radius: 0 var(--ac-radius-md) var(--ac-radius-md) 0;
  font-style: italic;
  color: var(--ac-neutral-700);
}

blockquote p {
  margin-bottom: 0;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: var(--ac-border);
  margin: var(--ac-space-8) 0;
}

/* Selection */
::selection {
  background: rgba(0,116,139,0.15);
  color: var(--ac-dark);
}


/* ==========================================================================
   4. LINK & FOCUS STYLES
   ========================================================================== */

a {
  color: var(--ac-primary);
  text-decoration: none;
  transition: color var(--ac-transition);
}

a:hover {
  color: var(--ac-primary-dark);
}

/* Underline animation for inline links */
.ac-link,
.entry-content p a:not(.ac-btn) {
  position: relative;
  text-decoration: none;
  color: var(--ac-primary);
  font-weight: var(--ac-weight-medium);
}

.ac-link::after,
.entry-content p a:not(.ac-btn)::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--ac-primary);
  transition: width var(--ac-transition);
}

.ac-link:hover::after,
.entry-content p a:not(.ac-btn):hover::after {
  width: 100%;
}

/* ---------- Accessibility: Focus Visible ---------- */
:focus-visible {
  outline: 3px solid var(--ac-accent, #EC4899);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
details summary:focus-visible {
  outline: 3px solid var(--ac-accent, #EC4899);
  outline-offset: 2px;
}
.ac-btn:focus-visible {
  outline-offset: 4px;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.4);
}

/* Skip link */
.ac-skip-link {
  position: absolute;
  top: -100%;
  left: var(--ac-space-4);
  z-index: var(--ac-z-tooltip);
  padding: var(--ac-space-3) var(--ac-space-6);
  background: var(--ac-dark);
  color: #fff;
  font-weight: var(--ac-weight-semibold);
  border-radius: 0 0 var(--ac-radius-md) var(--ac-radius-md);
  transition: top var(--ac-transition-fast);
}

.ac-skip-link:focus {
  top: 0;
  box-shadow: var(--ac-shadow-lg);
}


/* ==========================================================================
   5. CONTAINER & LAYOUT
   ========================================================================== */

.ac-container {
  width: 100%;
  max-width: var(--ac-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ac-space-6);
  padding-right: var(--ac-space-6);
}

.ac-container--sm { max-width: var(--ac-container-sm); }
.ac-container--md { max-width: var(--ac-container-md); }
.ac-container--lg { max-width: var(--ac-container-lg); }
.ac-container--2xl { max-width: var(--ac-container-2xl); }

/* Full-width breakout from GP content area */
.entry-content > .ac-hero,
.entry-content > .ac-trust-bar,
.entry-content > .ac-section,
.entry-content > .ac-reviews,
.entry-content > .ac-form-section,
.entry-content > [class*="ac-section"],
.entry-content > #preventivo {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Grid utility */
.ac-grid {
  display: grid;
  gap: var(--ac-gap);
}

.ac-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ac-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ac-grid--4 { grid-template-columns: repeat(4, 1fr); }
.ac-grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* Two-column with content + image */
.ac-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.ac-two-col--reverse {
  direction: rtl;
}

.ac-two-col--reverse > * {
  direction: ltr;
}

.ac-two-col--60-40 { grid-template-columns: 3fr 2fr; }
.ac-two-col--40-60 { grid-template-columns: 2fr 3fr; }

.ac-two-col__img {
  border-radius: var(--ac-radius);
  overflow: hidden;
  box-shadow: var(--ac-shadow);
}

.ac-two-col__img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--ac-radius);
  transition: transform 0.6s var(--ac-ease);
}

.ac-two-col__img:hover img {
  transform: scale(1.03);
}


/* ==========================================================================
   6. SECTION SYSTEM
   ========================================================================== */

.ac-section {
  padding: var(--ac-section-py) 0;
  position: relative;
}

.ac-section--alt {
  background: var(--ac-bg-alt);
}

.ac-section--dark {
  background: var(--ac-dark);
  color: rgba(255,255,255,0.85);
}

.ac-section--dark h2,
.ac-section--dark h3,
.ac-section--dark h4 {
  color: #fff;
}

.ac-section--dark p {
  color: rgba(255,255,255,0.8);
}

.ac-section--gradient {
  background: var(--ac-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.ac-section--gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.ac-section--gradient h2,
.ac-section--gradient h3,
.ac-section--gradient p {
  color: #fff;
  position: relative;
}

/* Section header with decorative underline */
.ac-section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--ac-space-12);
}

.ac-section-header h2 {
  position: relative;
  padding-bottom: 1.25rem;
}

.ac-section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--ac-gradient);
  border-radius: 2px;
}

.ac-section-header p {
  margin-left: auto;
  margin-right: auto;
  color: var(--ac-muted);
  font-size: var(--ac-text-lg);
}

/* Left-aligned section header */
.ac-section-header--left {
  text-align: left;
  margin-left: 0;
}

.ac-section-header--left h2::after {
  left: 0;
  transform: none;
}

/* Accent top line on page (decorative) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ac-gradient);
  z-index: calc(var(--ac-z-sticky) + 1);
  pointer-events: none;
}


/* ==========================================================================
   7. BUTTON SYSTEM
   ========================================================================== */

.ac-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ac-space-2);
  font-family: var(--ac-font);
  font-weight: var(--ac-weight-semibold);
  font-size: var(--ac-text-base);
  line-height: 1.2;
  padding: 0.875rem 2rem;
  border-radius: var(--ac-radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition:
    background var(--ac-transition),
    color var(--ac-transition),
    transform var(--ac-transition),
    box-shadow var(--ac-transition),
    border-color var(--ac-transition);
}

/* Ripple effect on click */
.ac-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 60%);
  transform: scale(0);
  transition: transform 0.5s var(--ac-ease);
  border-radius: inherit;
}

.ac-btn:active::before {
  transform: scale(2.5);
}

/* Primary button — Accent gradient */
.ac-btn--primary {
  background: var(--ac-accent);
  color: #fff;
  box-shadow: var(--ac-shadow-accent);
}

.ac-btn--primary:hover {
  background: var(--ac-accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(223,22,84,0.35);
}

.ac-btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(223,22,84,0.3);
}

.ac-btn--primary:focus-visible {
  box-shadow: var(--ac-focus-ring-accent);
}

/* Secondary button — Primary teal */
.ac-btn--secondary {
  background: var(--ac-primary);
  color: #fff;
  box-shadow: var(--ac-shadow-primary);
}

.ac-btn--secondary:hover {
  background: var(--ac-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,116,139,0.35);
}

.ac-btn--secondary:active {
  transform: translateY(0);
}

/* Outline button */
.ac-btn--outline {
  background: transparent;
  color: var(--ac-primary);
  border-color: var(--ac-primary);
}

.ac-btn--outline:hover {
  background: var(--ac-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--ac-shadow-primary);
}

/* Ghost button */
.ac-btn--ghost {
  background: transparent;
  color: var(--ac-primary);
  border-color: transparent;
}

.ac-btn--ghost:hover {
  background: var(--ac-primary-50);
  color: var(--ac-primary-dark);
}

/* White button (for dark backgrounds) */
.ac-btn--white {
  background: #fff;
  color: var(--ac-primary);
}

.ac-btn--white:hover {
  background: var(--ac-bg-alt);
  color: var(--ac-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--ac-shadow-xl);
}

/* Gradient button — signature Prima style */
.ac-btn--gradient {
  background: var(--ac-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(223,22,84,0.3);
}

.ac-btn--gradient:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(223,22,84,0.4);
  filter: brightness(1.08);
}

/* Button sizes */
.ac-btn--sm {
  font-size: var(--ac-text-sm);
  padding: 0.625rem 1.25rem;
}

.ac-btn--lg {
  font-size: var(--ac-text-lg);
  padding: 1rem 2.5rem;
}

.ac-btn--xl {
  font-size: var(--ac-text-xl);
  padding: 1.125rem 3rem;
}

/* Button with icon */
.ac-btn svg {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
}

/* Button arrow animation */
.ac-btn--arrow::after {
  content: '\2192';
  display: inline-block;
  transition: transform var(--ac-transition);
}

.ac-btn--arrow:hover::after {
  transform: translateX(4px);
}

/* Full-width button */
.ac-btn--full {
  width: 100%;
}


/* ==========================================================================
   8. FORM ELEMENTS
   ========================================================================== */

.ac-form-group {
  margin-bottom: var(--ac-space-5);
}

.ac-label {
  display: block;
  font-size: var(--ac-text-sm);
  font-weight: var(--ac-weight-semibold);
  color: var(--ac-dark);
  margin-bottom: var(--ac-space-2);
}

.ac-input,
.ac-select,
.ac-textarea {
  width: 100%;
  font-family: var(--ac-font);
  font-size: var(--ac-text-base);
  color: var(--ac-dark);
  background: #fff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-md);
  padding: 0.75rem 1rem;
  transition:
    border-color var(--ac-transition),
    box-shadow var(--ac-transition);
  -webkit-appearance: none;
  appearance: none;
}

.ac-input:hover,
.ac-select:hover,
.ac-textarea:hover {
  border-color: var(--ac-neutral-400);
}

.ac-input:focus,
.ac-select:focus,
.ac-textarea:focus {
  outline: none;
  border-color: var(--ac-primary);
  box-shadow: 0 0 0 3px rgba(0,116,139,0.15);
}

.ac-input::placeholder {
  color: var(--ac-neutral-400);
}

/* Select with custom arrow */
.ac-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Textarea */
.ac-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox / Radio */
.ac-checkbox,
.ac-radio {
  display: flex;
  align-items: flex-start;
  gap: var(--ac-space-3);
  cursor: pointer;
  font-size: var(--ac-text-base);
}

.ac-checkbox input[type="checkbox"],
.ac-radio input[type="radio"] {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15em;
  accent-color: var(--ac-primary);
  cursor: pointer;
}

/* Form on dark background */
.ac-section--dark .ac-input,
.ac-section--gradient .ac-input,
.ac-section--dark .ac-select,
.ac-section--gradient .ac-select,
.ac-section--dark .ac-textarea,
.ac-section--gradient .ac-textarea {
  background: rgba(255,255,255,0.95);
  border-color: rgba(255,255,255,0.3);
}


/* ==========================================================================
   9. CARD SYSTEM
   ========================================================================== */

.ac-card {
  background: #fff;
  border-radius: var(--ac-radius);
  padding: var(--ac-space-8);
  box-shadow: var(--ac-shadow);
  border: 1px solid var(--ac-border);
  position: relative;
  transition:
    transform var(--ac-transition),
    box-shadow var(--ac-transition),
    border-color var(--ac-transition);
}

/* Gradient top line — reveals on hover */
.ac-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--ac-gradient);
  border-radius: var(--ac-radius) var(--ac-radius) 0 0;
  opacity: 0;
  transition: opacity var(--ac-transition);
}

.ac-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ac-shadow-hover);
  border-color: transparent;
}

.ac-card:hover::before {
  opacity: 1;
}

/* Card icon */
.ac-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--ac-radius-md);
  background: var(--ac-primary-50);
  color: var(--ac-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--ac-space-5);
  transition: all var(--ac-transition);
}

.ac-card:hover .ac-card__icon {
  background: var(--ac-primary);
  color: #fff;
  transform: scale(1.05);
}

.ac-card h3 {
  font-size: var(--ac-h4);
  margin-bottom: var(--ac-space-3);
}

.ac-card p {
  font-size: var(--ac-text-sm);
  line-height: var(--ac-leading-relaxed);
  color: var(--ac-muted);
}

/* Card link with arrow */
.ac-card__link {
  font-weight: var(--ac-weight-semibold);
  font-size: var(--ac-text-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: var(--ac-space-4);
}

.ac-card__link::after {
  content: '\2192';
  transition: transform var(--ac-transition);
}

.ac-card__link:hover::after {
  transform: translateX(4px);
}

/* Card variants */
.ac-card--flat {
  box-shadow: none;
  border: 1px solid var(--ac-border);
}

.ac-card--flat:hover {
  box-shadow: var(--ac-shadow-md);
}

.ac-card--bordered-left {
  border-left: 4px solid var(--ac-primary);
}

.ac-card--dark {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
}

.ac-card--dark:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}


/* ==========================================================================
   10. BADGE & TAG
   ========================================================================== */

.ac-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ac-space-1);
  font-size: var(--ac-text-xs);
  font-weight: var(--ac-weight-semibold);
  padding: 0.25em 0.75em;
  border-radius: var(--ac-radius-full);
  letter-spacing: var(--ac-tracking-wide);
  text-transform: uppercase;
  line-height: 1.5;
}

.ac-badge--primary {
  background: var(--ac-primary-50);
  color: var(--ac-primary);
}

.ac-badge--accent {
  background: var(--ac-accent-50);
  color: var(--ac-accent);
}

.ac-badge--success {
  background: var(--ac-success-50);
  color: var(--ac-success-500);
}

.ac-badge--dark {
  background: var(--ac-dark);
  color: #fff;
}

/* Stars badge */
.ac-stars {
  color: var(--ac-star);
  letter-spacing: 2px;
  font-size: 1.1rem;
}


/* ==========================================================================
   11. UTILITY CLASSES
   ========================================================================== */

/* Text alignment */
.ac-text-left   { text-align: left; }
.ac-text-center { text-align: center; }
.ac-text-right  { text-align: right; }

/* Text color */
.ac-text-primary { color: var(--ac-primary); }
.ac-text-accent  { color: var(--ac-accent); }
.ac-text-muted   { color: var(--ac-muted); }
.ac-text-white   { color: #fff; }

/* Font weight */
.ac-font-medium   { font-weight: var(--ac-weight-medium); }
.ac-font-semibold { font-weight: var(--ac-weight-semibold); }
.ac-font-bold     { font-weight: var(--ac-weight-bold); }

/* Display */
.ac-flex   { display: flex; }
.ac-grid-d { display: grid; }
.ac-hidden { display: none; }
.ac-block  { display: block; }

/* Flex utilities */
.ac-items-center   { align-items: center; }
.ac-justify-center { justify-content: center; }
.ac-justify-between { justify-content: space-between; }
.ac-flex-wrap      { flex-wrap: wrap; }
.ac-gap-2 { gap: var(--ac-space-2); }
.ac-gap-4 { gap: var(--ac-space-4); }
.ac-gap-6 { gap: var(--ac-space-6); }
.ac-gap-8 { gap: var(--ac-space-8); }

/* Margin */
.ac-mt-0   { margin-top: 0; }
.ac-mt-4   { margin-top: var(--ac-space-4); }
.ac-mt-8   { margin-top: var(--ac-space-8); }
.ac-mt-12  { margin-top: var(--ac-space-12); }
.ac-mb-0   { margin-bottom: 0; }
.ac-mb-4   { margin-bottom: var(--ac-space-4); }
.ac-mb-8   { margin-bottom: var(--ac-space-8); }
.ac-mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.ac-p-4  { padding: var(--ac-space-4); }
.ac-p-6  { padding: var(--ac-space-6); }
.ac-p-8  { padding: var(--ac-space-8); }
.ac-py-4 { padding-top: var(--ac-space-4); padding-bottom: var(--ac-space-4); }
.ac-py-8 { padding-top: var(--ac-space-8); padding-bottom: var(--ac-space-8); }

/* Border radius */
.ac-rounded     { border-radius: var(--ac-radius); }
.ac-rounded-md  { border-radius: var(--ac-radius-md); }
.ac-rounded-full { border-radius: var(--ac-radius-full); }

/* Shadow */
.ac-shadow-sm { box-shadow: var(--ac-shadow-sm); }
.ac-shadow-md { box-shadow: var(--ac-shadow-md); }
.ac-shadow-lg { box-shadow: var(--ac-shadow-lg); }

/* Max-width for text blocks */
.ac-max-w-prose { max-width: 75ch; }
.ac-max-w-lg    { max-width: 800px; }

/* Screen reader only */
.ac-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive visibility */
@media (max-width: 767px) {
  .ac-hide-mobile { display: none; }
}
@media (min-width: 768px) {
  .ac-hide-desktop { display: none; }
}


/* ==========================================================================
   12. ACCESSIBILITY
   ========================================================================== */

/* Ensure sufficient touch targets on mobile */
@media (max-width: 768px) {
  a, button, [role="button"],
  input[type="submit"],
  input[type="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .ac-btn {
    border: 2px solid ButtonText;
  }
  .ac-card {
    border: 1px solid CanvasText;
  }
}


/* ==========================================================================
   13. PRINT STYLES
   ========================================================================== */

@media print {
  body {
    color: #000;
    background: #fff;
    font-size: 12pt;
  }

  body::before,
  .ac-header,
  .ac-top-bar,
  .ac-footer,
  .ac-trust-bar,
  .ac-form-section,
  .ac-btn,
  nav {
    display: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  .ac-section--dark,
  .ac-section--gradient {
    background: #fff;
    color: #000;
  }

  .ac-section--dark h2,
  .ac-section--dark p,
  .ac-section--gradient h2,
  .ac-section--gradient p {
    color: #000;
  }
}


/* ==========================================================================
   14. RESPONSIVE GRID BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
  .ac-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .ac-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --ac-section-py: clamp(2.5rem, 6vw, 4rem);
    --ac-gap: 1.5rem;
  }

  .ac-container {
    padding-left: var(--ac-space-4);
    padding-right: var(--ac-space-4);
  }

  .ac-grid--4,
  .ac-grid--3,
  .ac-grid--2 {
    grid-template-columns: 1fr;
  }

  .ac-two-col {
    grid-template-columns: 1fr;
    gap: var(--ac-space-8);
  }

  .ac-two-col--reverse {
    direction: ltr;
  }

  .ac-section-header {
    margin-bottom: var(--ac-space-8);
  }

  body::before {
    height: 2px;
  }
}

@media (max-width: 480px) {
  .ac-btn {
    width: 100%;
    justify-content: center;
  }

  .ac-btn--lg,
  .ac-btn--xl {
    padding: 0.875rem 1.5rem;
    font-size: var(--ac-text-base);
  }
}
