/* ============================================================
   global.css — System Design Tokens + Reset + Base Styles
   AdresDoNajmu.pl | Stitch Design System (RZECZYWISTA PALETA)
   Primary: Deep Purple #2E1065
   Surface: Warm White #F8FAFC
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens — ze Stitch)
   ============================================================ */
:root {
    /* === PRIMARY (Deep Purple #2E1065) === */
    --color-primary:          #2E1065;
    --color-primary-dark:     #1e0a44;
    --color-primary-light:    #4a1fa8;
    --color-primary-fixed:    #ede8ff;
    --color-primary-fixed-dim:#c4b5fd;

    /* === SECONDARY (Emerald Green — secondary-container) === */
    --color-secondary-container: #D1FAE5;
    --color-on-secondary-container: #065F46;

    /* === SURFACE (Warm White) === */
    --color-surface-base:         #F8FAFC;   /* slate-50 */
    --color-surface-low:          #f1f5f9;   /* slate-100 */
    --color-surface-container:    #e2e8f0;   /* slate-200 */
    --color-surface-high:         #e2e8f0;
    --color-surface-highest:      #cbd5e1;   /* slate-300 */
    --color-surface-lowest:       #ffffff;
    --color-outline-var:          #e2e8f0;   /* slate-200 */

    /* === TEXT === */
    --color-on-surface:       #1E293B;   /* slate-800 */
    --color-on-surface-var:   #475569;   /* slate-600 */
    --color-on-primary:       #ffffff;

    /* === STATE COLORS === */
    --color-error:            #dc2626;
    --color-success:          #065F46;

    /* === BORDER / OUTLINE === */
    --color-outline:          #94a3b8;   /* slate-400 */

    /* === GRADIENT (Hero + CTA) === */
    --gradient-primary: linear-gradient(135deg, #2E1065 0%, #4a1fa8 100%);
    --gradient-dark:    linear-gradient(135deg, #1e0a44 0%, #2E1065 100%);

    /* === TYPOGRAPHY === */
    --font-family:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-regular:  400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;
    --font-weight-extrabold:800;
    --font-weight-black:    900;

    /* Font scale */
    --text-xs:   0.625rem;  /* 10px */
    --text-sm:   0.875rem;  /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg:   1.125rem;  /* 18px */
    --text-xl:   1.25rem;   /* 20px */
    --text-2xl:  1.5rem;    /* 24px */
    --text-3xl:  1.875rem;  /* 30px */
    --text-4xl:  2.25rem;   /* 36px */
    --text-5xl:  3rem;      /* 48px */
    --text-6xl:  4rem;      /* 64px */

    /* === SPACING === */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;

    /* === BORDER RADIUS (ze Stitch: minimal — 0.125rem base, xl=1rem) === */
    --radius-sm:   2px;
    --radius-md:   8px;
    --radius-lg:   12px;     /* rounded-lg */
    --radius-xl:   16px;     /* rounded-xl */
    --radius-2xl:  24px;
    --radius-3xl:  40px;
    --radius-full: 9999px;

    /* === SHADOWS === */
    --shadow-xs:  0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-sm:  0 2px 8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226,232,240,0.7);
    --shadow-md:  0 10px 40px -15px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(226,232,240,0.5);
    --shadow-lg:  0 20px 60px -20px rgba(46, 16, 101, 0.15);
    --shadow-xl:  0 25px 70px -20px rgba(46, 16, 101, 0.2);

    /* === TRANSITIONS === */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.4s ease;

    /* === LAYOUT === */
    --container-max:     1280px;
    --container-pad:     clamp(var(--space-4), 5vw, var(--space-16));
    --header-height:     72px;

    /* === GLASSMORPHISM (Header sticky) === */
    --glass-bg:           rgba(255, 255, 255, 0.95);
    --glass-blur:         16px;
    --glass-border:       rgba(226, 232, 240, 0.8);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    line-height: 1.6;
    color: var(--color-on-surface);
    background-color: var(--color-surface-lowest);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    width: 100%;
    max-width: 100vw;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-light); }

ul, ol { list-style: none; }

button {
    cursor: pointer;
    font-family: var(--font-family);
    border: none;
    background: none;
}

input, textarea, select {
    font-family: var(--font-family);
    font-size: var(--text-base);
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.section      { padding: var(--space-24) 0; }
.section--lg  { padding: var(--space-32) 0; }
.section--sm  { padding: var(--space-12) 0; }

/* ============================================================
   TYPOGRAPHY (Stitch: font-black, uppercase headings)
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-black);
    line-height: 1.1;
    color: var(--color-on-surface);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(var(--text-4xl), 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}
h2 {
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-xl); font-weight: var(--font-weight-extrabold); }
h5 { font-size: var(--text-base); font-weight: var(--font-weight-black); text-transform: uppercase; letter-spacing: 0.1em; }
h6 { font-size: var(--text-xs); font-weight: var(--font-weight-black); text-transform: uppercase; letter-spacing: 0.3em; }

p {
    color: var(--color-on-surface-var);
    line-height: 1.7;
    font-weight: var(--font-weight-medium);
}

.text-primary   { color: var(--color-primary); }
.text-muted     { color: var(--color-on-surface-var); }
.text-white     { color: #fff; }
.text-center    { text-align: center; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.3em; font-weight: var(--font-weight-black); font-size: var(--text-xs); }

/* Section Eyebrow */
.eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-black);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-on-surface-var);
    margin-bottom: var(--space-4);
}

/* Section header */
.section-header { margin-bottom: var(--space-12); }
.section-header--center {
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--space-16);
}

/* ============================================================
   BUTTONS (Stitch style: uppercase, small tracking, bold)
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-black);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    white-space: nowrap;
}

/* Primary */
.btn-primary {
    background: var(--color-primary);
    color: var(--color-on-primary);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 8px 32px rgba(46, 16, 101, 0.3);
    color: var(--color-on-primary);
}

/* ==============================================================
   GHOST HOVER — применяется к кнопкам «Zamów» карточек услуг + header + hero
   Фон исчезает, появляется рамка, текст меняет цвет
   Кнопки «Więcej» (.btn-outline) используют свой стандартный hover
   ============================================================== */

/* --- Ghost для фиолетовых (btn-primary): кнопки «Zamów» в карточках услуг --- */
#cta-s1-order.btn-primary,
#cta-s2-order.btn-primary,
#cta-s3-order.btn-primary,
#cta-s4-order.btn-primary,
#header-cta.btn-primary,
#mobile-cta.btn-primary {
    border: 2px solid transparent;
    overflow: visible;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}
#cta-s1-order.btn-primary:hover,
#cta-s2-order.btn-primary:hover,
#cta-s3-order.btn-primary:hover,
#cta-s4-order.btn-primary:hover,
#header-cta.btn-primary:hover,
#mobile-cta.btn-primary:hover {
    opacity: 1;
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: none;
}

/* --- Ghost для белых (btn-white): «Zamów teraz» в герое + «Zamów rozmowę» в форме ---
   При ховере: фон белый исчезает, рамка белая, текст белый
   (так как они расположены на тёмном/фиолетовом фоне) */
#hero-cta-order.btn-white,
#consult-submit.btn-white {
    border: 2px solid transparent;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
#hero-cta-order.btn-white:hover,
#consult-submit.btn-white:hover {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: none;
}



/* Outline (border-2 border-primary) */
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* Ghost (na ciemnym tle) */
.btn-ghost {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}
.btn-ghost:hover {
    background: #fff;
    color: var(--color-primary);
}

/* White (na kolorowym tle) */
.btn-white {
    background: #fff;
    color: var(--color-primary);
}
.btn-white:hover {
    background: var(--color-surface-low);
    color: var(--color-primary);
}

/* Sizes */
.btn-sm  { padding: 0.75rem 1.25rem; font-size: 10px; }
.btn-lg  { padding: 1.125rem 2.5rem; font-size: var(--text-sm); min-height: 56px; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--color-surface-lowest);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-outline-var);
    padding: var(--space-8);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-xs);
}
.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.form-label {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-black);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-on-surface);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: var(--color-surface-lowest);
    border: 2px solid var(--color-outline-var);
    border-radius: var(--radius-lg);
    color: var(--color-on-surface);
    font-size: var(--text-base);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(46, 16, 101, 0.08);
}
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-outline);
}
.form-textarea { resize: vertical; min-height: 120px; }

/* ============================================================
   SURFACE BACKGROUNDS
   ============================================================ */
.bg-primary     { background: var(--color-primary); }
.bg-gradient    { background: var(--gradient-primary); }
.bg-surface     { background: var(--color-surface-base); }
.bg-surface-low { background: var(--color-surface-base); }
.bg-white       { background: var(--color-surface-lowest); }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: var(--font-weight-black);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.badge-primary { background: var(--color-primary-fixed); color: var(--color-primary); }
.badge-success { background: var(--color-secondary-container); color: var(--color-on-secondary-container); }

/* ============================================================
   MATERIAL SYMBOLS
   ============================================================ */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ============================================================
   SPACERS & DIVIDERS
   ============================================================ */
.spacer-sm  { height: var(--space-8); }
.spacer-md  { height: var(--space-12); }
.spacer-lg  { height: var(--space-20); }

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
.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;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* ============================================================
   GRID & FLEX
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-8); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-8); }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-4    { gap: var(--space-4); }
.flex-gap-6    { gap: var(--space-6); }

/* ============================================================
   PLACEHOLDER (серая заглушка)
   ============================================================ */
.placeholder-box {
    background: var(--color-surface-low);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-outline);
    font-size: 10px;
    font-weight: var(--font-weight-black);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    user-select: none;
}
.placeholder-video  { aspect-ratio: 16 / 9; }
.placeholder-img    { aspect-ratio: 4 / 3; }
.placeholder-img-wide { aspect-ratio: 16 / 10; }
.placeholder-avatar { width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-ring {
    0%       { transform: scale(0.33); opacity: 1; }
    80%, 100%{ opacity: 0; }
}
@keyframes scrollLeft {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes counterUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease both;
}
.animate-fade-up-delay-1 { animation-delay: 0.1s; }
.animate-fade-up-delay-2 { animation-delay: 0.2s; }
.animate-fade-up-delay-3 { animation-delay: 0.3s; }
.animate-pulse-ring      { animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface-low); }
::-webkit-scrollbar-thumb { background: var(--color-outline); border-radius: var(--radius-full); }

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
    background: var(--color-primary-fixed);
    color: var(--color-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    :root { --header-height: 64px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section    { padding: var(--space-12) 0; }
    .section--lg { padding: var(--space-16) 0; }

    /* Ukryj nawigację okruszkową (breadcrumb) na wszystkich stronach */
    nav[aria-label="Nawigacja okruszkowa"] {
        display: none;
    }
}
