/*
 * IP Design System — tokens.css (regenerated, final — synced 2026-09-29, v4)
 * Source of truth: the "IP Design System" artifact (Claude).
 * Full component rules and rationale: IP-Design-System.md (project root) -
 * pending an update pass of its own; where the two disagree, this sync and
 * the live design system artifact win (see this pass's commit for the full
 * list of what changed: button variant names, badge/sponsored-card colors,
 * alert icon colors, new Unverified badge).
 *
 * Do not hardcode hex colors, px spacing/padding/margin, or border-radius
 * values anywhere else in the codebase — reference these variables instead.
 * If a value you need doesn't exist here, flag it rather than inventing one.
 *
 * The --ip-* aliases near the end of this file are back-compat names for
 * the pre-rename token set (--ip-color-primary, --ip-space-md, etc.) —
 * still referenced ~90+ times by public/css/flow-forms.css (the
 * login/verify/plans/newListing/claim flow pages' shared .ipflow-*
 * component styles) plus header.blade.php/footer.blade.php/verify.blade.php.
 * Do NOT remove these without first updating every one of those references
 * to the new names directly — dropping them silently breaks that CSS
 * (undefined custom properties resolve to nothing, not the old value).
 * Checked against this pass's rename list: none of the --ip-* aliases below
 * point at a name that got renamed (--button-soft-fill* -> now
 * --button-secondary-fill*, --success/--success-strong now alias
 * --secondary/--secondary-dark instead of the reverse) only affected the
 * Button/Alert/Badge components' own CSS, updated separately, so no alias
 * target needed to change here.
 */

:root {
  /* ---- Color: Primary & Secondary (parallel brand pair) ----
     --secondary/--secondary-dark are their own canonical brand values
     as of the 2026-09-29 design system sync (v4) - previously aliased
     the OTHER way, to --success/--success-strong, which worked
     numerically but named a brand color after an alert semantic by
     coincidence. --success/--success-strong below are now back-compat
     aliases pointing at these instead, so every existing
     var(--success-strong, ...) reference across web.css/plan-tiles.css
     keeps resolving to the same value unchanged. */
  --primary: var(--brand-blue);
  --primary-dark: var(--brand-blue-dark);
  --secondary: #5ca614;             /* secondary brand green - deliberate rebrand, was #8ab738 live */
  --secondary-dark: #47810f;        /* accessible fill for white content on green */

  /* ---- Color: Button fills (component-level, not brand colors) ----
     v4 renamed the Button variant back to Secondary (it had been Soft,
     to avoid colliding with the brand color name above) - now
     disambiguated in code by prefix instead: every button token starts
     `button-`, so --button-secondary-fill and the brand --secondary
     above never collide despite sharing a word. --button-soft-fill* and
     the Tertiary/Outline equivalents kept below as back-compat aliases -
     .btn-outline had zero call sites sitewide, so no old Tertiary/Outline
     token names existed to alias here. */
  --button-primary-fill: var(--brand-blue);
  --button-primary-hover: var(--brand-blue-dark);
  --button-primary-active: #224b6d; /* NEW: Primary's own pressed state - previously reused brand-blue-dark for both hover and active */
  --button-secondary-fill: #eef3f7;
  --button-secondary-hover: #dfeaf2;
  --button-secondary-active: #cfe0ec;
  --button-soft-fill: var(--button-secondary-fill);
  --button-soft-fill-hover: var(--button-secondary-hover);
  --button-soft-fill-active: var(--button-secondary-active);
  /* Outline Button family (IP-Outline-Buttons.md, 2026-09-30): the ONE
     shared state set for every hollow control - nav tabs, PL|EN toggle,
     Map/List view switcher, listing category tags, expanded subcategory
     rows, icon buttons (Copy, modal Close), scroll-to-top, the contact
     pills on the listing cards, and the Tertiary button variant. Hover and
     active share the same light blue. Consumed by public/css/ip-outline.css.
     IP-Buttons-Color-Consistency.md (2026-10-09) adds the two border steps
     below: the border WIDTH never changes (1px in every state, so nothing
     shifts), only its colour - light blue on hover, brand blue when pressed
     or selected. The handoff's token names map to ours as: surface-2 =
     --button-outline-fill, border-strong = --button-outline-border,
     text-primary = --button-outline-text, bg-accent = --button-outline-hover
     / -active, border-accent = --button-outline-hover-border, fill-accent =
     --button-outline-active-border, text-accent = --brand-blue (the AI
     button's text and icon, the one control whose text stays blue). */
  --button-outline-border: #dedede;
  --button-outline-fill: #ffffff;
  --button-outline-text: #44555b;
  --button-outline-hover: #eef3f7;
  --button-outline-hover-border: var(--info-border);   /* NEW 2026-10-09: an existing colour, the light-blue border token */
  --button-outline-active: #eef3f7;
  --button-outline-active-border: var(--brand-blue);   /* NEW 2026-10-09: an existing colour */
  --button-outline-active-text: #3270a2;
  /* Tertiary IS the outline family's Button variant - its hover/active
     now point at the same light blue (were the grey --surface-100 /
     --border, per the same handoff). */
  --button-tertiary-border: var(--button-outline-border);
  --button-tertiary-hover: var(--button-outline-hover);
  --button-tertiary-active: var(--button-outline-active);
  --button-danger-fill: var(--danger-text);
  --button-danger-hover: var(--danger-dark);
  --button-danger-active: var(--danger-darker);
  --button-success-fill: var(--secondary-dark);
  --button-success-hover: var(--success-strong-dark);
  --button-success-active: #2f560a; /* NEW: Success/Search's own pressed state - previously reused success-strong-dark for both hover and active */

  /* ---- Color: canonical brand bases ---- */
  --brand-blue: #3270a2;
  --brand-blue-dark: #295b84;
  --success: var(--secondary);      /* back-compat alias, see note above */
  --warning: #866e43;
  --danger: #9e4a46;
  --info: var(--brand-blue);

  /* ---- Color: button state colors (hover/pressed, not alert colors) ---- */
  --success-strong: var(--secondary-dark);  /* back-compat alias, see note above */
  --success-strong-dark: #38670c;
  --success-dark: #498410;
  --danger-dark: #813c39;
  --danger-darker: #6b322f;

  /* ---- Color: Alerts - exactly 4 colors each (bg/border/icon/text) ----
     Icon formalized as its own named token per type (v4) - Success's
     icon now uses secondary-dark (was success-text, too dark/muddy at
     icon size); Warning/Info/Danger's icon equals their existing text
     color, just wasn't named separately before. Danger's alert CSS
     itself was wrong before this pass - it used --danger-dark (the
     BUTTON hover shade, #813c39) for both icon and text instead of the
     real danger/-text/-border value (#9e4a46) every other Danger surface
     (buttons, form-field errors) already used; fixed in web.css's
     .alert-danger, not just renamed here. */
  --success-text: #294a09;
  --success-bg: #f3f8ee;
  --success-border: #dbebcb;
  --success-icon: var(--secondary-dark);

  --warning-text: var(--warning);
  --warning-bg: #fcf8e5;
  --warning-border: #c8bdaa;        /* darkened from live #f8ebd0 - was too bright */
  --warning-icon: var(--warning);

  --danger-text: var(--danger);
  --danger-bg: #efdfdf;
  --danger-border: var(--danger);
  --danger-icon: var(--danger);

  --info-text: var(--info);
  --info-bg: #eaf0f5;
  --info-border: #d3e2ec;
  --info-icon: var(--info);

  /* ---- Color: listing badges ----
     Reversed back to a pill-with-background look (2026-09-29 v4 had
     briefly made this icon + colored text only, no background - direct
     owner second thoughts brought the background back, minus the icon
     this time). *-text stays the same color used for the pill's text;
     *-bg is a light tint behind it, same pattern as --danger-bg/
     --info-bg above. Sponsored reuses --sponsored-card-bg directly
     (same light-blue family as the sponsored card itself) rather than a
     separate token. */
  --badge-sponsored-text: var(--brand-blue);
  --badge-verified-text: #3f720d;
  --badge-unverified-text: #825e08;

  /* IP-Listing-Badges-and-Admin-Verification-Status (2026-10-03): the public
     status badges are 24px icon-only circles. Circle fill = *-bg, glyph =
     *-icon. The *-text tokens above stay for admin text labels only.
     --badge-verified-bg and --badge-unverified-bg changed value here
     (#e8f2e0 -> #ebf4e2, #f5efe0 -> #f8f0da); every use of them is a listing
     badge. */
  --badge-sponsored-bg: #e6eff7;
  --badge-sponsored-icon: #3270a2;
  --badge-verified-bg: #ebf4e2;
  --badge-verified-icon: #3f720d;
  --badge-unverified-bg: #f8f0da;
  --badge-unverified-icon: #825e08;
  --badge-noaddress-bg: #ececec;
  --badge-noaddress-icon: #5f5f5f;

  /* ---- Color: badge-only colors (plan badges + sponsored card) ---- */
  --recommended-green: #4b7443;
  --recommended-green-dark: #3f6238;
  --sponsored-card-bg: #f5f8fb;     /* v4: was #fdf8f0 (cream) - now a light blue wash, and the left border is gone (see .sponsored-card in web.css) */
  /* Results card hover / pressed background (owner 2026-10-09, picked from options): a sky tint - clearly different from
     the contact pills' own hover (--button-outline-hover, light blue-grey), which the old card hover shared, so a hovered
     pill melted into a hovered card; and clearly different from the grey page (#f2f2f2) behind the cards. An alias of
     an existing colour, no new value. */
  --listing-card-hover: var(--category-sky-tint);

  /* ---- Color: heritage / logo red ---- */
  --brand-red: #d4213d;
  --brand-red-dark: #a91a30;
  --promo-red: #b24334;
  --promo-red-dark: #91362a;

  /* ---- Color: neutrals ---- */
  --ink: #44555b;
  --ink-muted: #757575;
  --ink-subtle: #828282;
  --surface: #ffffff;
  --surface-100: #f2f2f2;
  --border: #dedede;
  --border-strong: #80838a;

  /* ---- Color: links & utility ---- */
  --link-hover: #3c77a6;
  --footer-bg: #333333;             /* confirmed from production CSS */
  --focus-ring: #3270a2;            /* IP-Mobile-Search.md Part B (2026-09-30): brand-blue, same value as --brand-blue; was the off-palette #2e6fe0 */
  --focus-ring-inner: #ffffff;      /* NEW (search bar v4): inner ring of the two-ring focus indicator on dark backgrounds - focus-ring alone is only 2.7:1 on surface-inverse, below 3:1 */
  --tile-divider: #9fbad2;          /* RETIRED 2026-09-30: the Category Tile redesign removed the divider; kept for reference only */

  /* ---- Color: Category tile hues (design system tokens.json, 2026-09-30) ----
     Ten hue pairs for the 18 main-category tiles: --category-<hue> is the
     Phosphor icon color, --category-<hue>-tint the 40x40 square behind
     it; every pair checked >= 3.6:1 (icon on tint). Which category gets
     which hue lives in config/category_styles.php. No red: brand-red is
     logo-only. */
  --category-teal: #13857a;         --category-teal-tint: #e2f3f1;
  --category-indigo: #5a5fc7;       --category-indigo-tint: #ecedfb;
  --category-orange: #c4610c;       --category-orange-tint: #fcefe2;
  --category-amber: #a06d08;        --category-amber-tint: #f8f0da;
  --category-blue: var(--brand-blue); --category-blue-tint: #e6eff7;
  --category-green: #4f8a1c;        --category-green-tint: #ebf4e2;
  --category-slate: #5b6b82;        --category-slate-tint: #eceff4;
  --category-pink: #b8457c;         --category-pink-tint: #fae8f0;
  --category-sky: #1f7fa8;          --category-sky-tint: #e3f2f8;
  --category-purple: #8a4fb8;       --category-purple-tint: #f3eafa;

  /* ---- Color: illustration (owner 2026-11-20) ----
     The sun in the listing page's claim card (public/css/ip-listing-claim-card.css): a soft orange - the owner asked for
     "less saturated and more orange" than the red dot it replaced. A NEW colour: no other token has this value. */
  --illustration-sun: #f2a65a;

  /* ---- Color: inverse surface (dark bands) — NEW (search bar v4)
     surface-inverse is an alias of footer-bg so the two stay in sync;
     used for any full-width dark band (the search band behind the
     search bar, the footer), not just the footer specifically. ---- */
  --surface-inverse: var(--footer-bg);
  --ink-inverse: #ffffff;
  --ink-inverse-muted: #dedede;
  --border-inverse: rgba(255, 255, 255, 0.4);
  --chip-inverse-hover: rgba(255, 255, 255, 0.12);

  /* ---- Type ---- */
  --font-sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-heading: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Type scale (§3, "final") ----
     Sizes/line-heights changed multiple times upstream - this is the
     final table, don't reconcile against an earlier version of it.
     h4 weight is 500 here (was 400 in the previous sync) - matches the
     current CLAUDE.md instruction of 600/600/500/500. */
  --h1-size: 34px;   --h1-line-height: 40px; --h1-weight: 600;
  --h2-size: 28px;   --h2-line-height: 36px; --h2-weight: 600;
  --h3-size: 22px;   --h3-line-height: 28px; --h3-weight: 500;
  --h4-size: 18px;   --h4-line-height: 24px; --h4-weight: 500;
  --listing-title-size: 20px; --listing-title-line-height: 24px; --listing-title-weight: 400;

  --body-lg-size: 20px; --body-lg-line-height: 28px; --body-lg-weight: 400;
  --body-size: 16px;    --body-line-height: 24px;    --body-weight: 400;
  --body-sm-size: 12px; --body-sm-line-height: 16px; --body-sm-weight: 400;
  --caption-size: 12px; --caption-line-height: 16px; --caption-weight: 500;
  --label-size: 12px;   --label-line-height: 16px;   --label-weight: 600;
  --button-lg-size: 16px; --button-lg-line-height: 20px; --button-lg-weight: 600;
  --button-md-size: 14px; --button-md-line-height: 18px; --button-md-weight: 600;
  --button-sm-size: 12px; --button-sm-line-height: 16px; --button-sm-weight: 600;
  --tile-label-size: 16px; --tile-label-line-height: 20px; --tile-label-weight: 500;

  /* ---- Spacing (4px base) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* ---- Radius (strict 4/8/12/16 rhythm) ---- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* ---- Elevation ---- */
  --elevation-1: 0 1px 2px rgba(68, 85, 91, 0.10);
  --elevation-2: 0 4px 8px rgba(68, 85, 91, 0.14);
  --elevation-3: 0 8px 16px rgba(68, 85, 91, 0.18);
  --elevation-on-dark: 0 4px 8px rgba(0, 0, 0, 0.25); /* NEW (search bar v4): the ink-tinted elevation-1..3 disappear against surface-inverse, so a white control there (the search bar) needs a black-based shadow instead */
  --elevation-up-on-dark: 0 -2px 8px rgba(0, 0, 0, 0.25); /* NEW (consent bar, 2026-10-29): the same black-based shadow thrown UPWARD, for a bar fixed to the bottom edge of the screen that casts over the page */

  /* ---- Back-compat aliases — see file header. Referenced by
     flow-forms.css and 3 Blade files; do not remove without migrating
     those references first. ---- */
  --ip-color-primary: var(--brand-blue);
  --ip-color-primary-dark: var(--brand-blue-dark);
  --ip-color-dark: var(--ink);
  --ip-color-accent: var(--success-strong);
  --ip-color-warn: var(--danger);
  --ip-color-muted: var(--ink-subtle);
  --ip-color-white: var(--surface);
  --ip-color-bg-light: var(--surface-100);
  --ip-color-border: var(--border);

  --ip-color-success: var(--success-strong);
  --ip-color-success-bg: var(--success-bg);
  --ip-color-error: var(--danger);
  --ip-color-error-bg: var(--danger-bg);
  --ip-color-warning-text: var(--warning);
  --ip-color-warning-bg: var(--warning-bg);
  --ip-color-info: var(--info);
  --ip-color-info-bg: var(--info-bg);

  --ip-font-body: var(--font-sans);
  --ip-font-heading: var(--font-heading);

  --ip-space-xs: var(--space-2);  /* 6px -> 8px */
  --ip-space-sm: var(--space-3);  /* 10px -> 12px */
  --ip-space-md: var(--space-4);  /* 15px -> 16px */
  --ip-space-lg: var(--space-5);  /* 20px -> 24px */
  --ip-space-xl: var(--space-6);  /* 25px -> 32px, kept distinct from lg */

  --ip-radius-sm: var(--radius-sm);
  --ip-radius-tab: 4px 4px 0 0;
  --ip-radius-round: 50%;

  /* Layout - no equivalent in the new doc, left as-is */
  --ip-form-width: 560px;

  /* ---- Page spacing (IP-Design-Updates-Session-1.md Item 6, values
     confirmed by the owner 2026-10-01, decision D3) ----
     Three gaps every public page shares, each with a desktop and a phone
     value (the phone set is in the media query right below this block):
       --page-top     breadcrumb bar / search band  -> page title or first content block
       --title-gap    page title                    -> next element (filter row, cards, header)
       --page-bottom  last content block            -> footer
     Applied in web.css (one rule per page shape) - never re-add a
     one-off margin/padding for one of these three gaps on a page. */
  --page-top: 40px;
  --title-gap: 16px;
  --page-bottom: 80px;
  /* IP-UI-Fixes-2026-10-01 item 3: under a breadcrumb bar the page-top is
     half the plain value (the bar's own 10px padding already separates
     it from the band) - results pages and the listing page. */
  --page-top-breadcrumb: 20px;
}
@media (max-width: 767px) {
  :root {
    --page-top: 24px;
    --title-gap: 12px;
    --page-bottom: 56px;
    --page-top-breadcrumb: 12px;
  }
}

/* ---- Header / search / hero / results layout (handoff "IP Header, Search, Hero & Results", 2026-10-05) ----
   Values from the IP Design System tokens.json of that date. Component-level tokens: used by
   public/css/ip-chrome.css only. The two breakpoints are documented here because CSS custom properties
   cannot be used inside @media queries: desktop >= 1024px, tablet 700-1023px, phone < 700px. */
:root {
  --surface-page: #f4f4f4;
  --hero-overlay-top: rgba(255, 255, 255, 0.8);
  --hero-overlay-mid: rgba(255, 255, 255, 0.6);
  --hero-overlay-bottom: rgba(255, 255, 255, 0);
  --stats-band-bg: rgba(255, 255, 255, 0.88);
  --stats-divider: #c9ced1;
  --scrim: rgba(0, 0, 0, 0.5);
  --button-ai-fill: #eef3f7;
  --button-ai-hover: #dfeaf2;
  --cluster-amber: #f0a21b;
  --elevation-search: 0 4px 12px rgba(68, 85, 91, 0.22);
  --elevation-search-band: 0 4px 12px rgba(68, 85, 91, 0.16);
  --elevation-band: 0 2px 6px rgba(68, 85, 91, 0.08);
  --elevation-map-control: 0 4px 12px rgba(68, 85, 91, 0.2);
  --elevation-menu: 0 12px 24px rgba(0, 0, 0, 0.18);
  --elevation-sheet: 0 12px 32px rgba(0, 0, 0, 0.3);
  --container-max: 1184px;
  --header-max: 1312px;
  --menu-separator: #eef0f1;
  --breakpoint-desktop: 1024px;
  --breakpoint-tablet: 700px;
}

/* ---- Dark header (handoff "IP - Dark header + Featured logo tiles fill the box", owner 2026-10-06) ----
   The top band (logo + navigation) is the footer grey; the search band and everything below stay white.
   Names are this file's own proposal (the handoff gave values only) - used by public/css/ip-chrome.css. */
:root {
  --header-dark-bg: var(--surface-inverse);              /* #333333, same as the footer */
  --header-dark-ink: var(--ink-inverse);                 /* nav links, toggle text, menu icon */
  --header-dark-link-accent: #a9cdee;                    /* "+ Dodaj wpis" */
  --header-dark-border: rgba(255, 255, 255, 0.45);       /* PL/EN toggle track, menu button */
  --header-dark-hover: rgba(255, 255, 255, 0.14);        /* toggle segment hover */
  --header-dark-active: rgba(255, 255, 255, 0.16);       /* menu button, open */
  --header-dark-separator: rgba(255, 255, 255, 0.12);    /* rows of the menu panel */
  --header-dark-shadow: 0 12px 24px rgba(0, 0, 0, 0.35); /* menu panel */
  --header-dark-focus: #ffffff;                          /* focus ring inside the header */
}
