* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
:root { --primary-color: #ffcc00; --dark-color: #1a1a1a; --light-color: #f9f9f9; --text-color: #333; --brand-blue: #002244; --brand-red: #d90000; }
html { scroll-behavior: smooth; }
body { color: var(--text-color); background-color: var(--light-color); line-height: 1.6; }
header { background-color: #ffffff; color: var(--dark-color); padding: 15px 50px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 4px solid var(--brand-blue); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
#bar { position: absolute; left: 0; bottom: -4px; height: 4px; width: 0; background: var(--primary-color); }
header { overflow-x: clip; }
#bar::after { content: '⚡'; position: absolute; right: 0; top: 50%; transform: translate(50%, -50%); font-size: 18px; line-height: 1; display: block; pointer-events: none; }
.logo-container { display: flex; align-items: center; justify-self: start; }
.logo-link { display: block; text-decoration: none; cursor: pointer; }
.logo-img { height: 75px; width: auto; display: block; }
.header-phones { display: flex; justify-content: center; gap: 14px; padding: 0 20px; }
.phone-pill { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 0; background: #ffffff; border: 1px solid #c9d1db; border-radius: 0; text-decoration: none; }
.phone-icon { width: 44px; height: 44px; border-radius: 0; background: var(--brand-blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.phone-icon svg { width: 20px; height: 20px; fill: #ffffff; }
.phone-text { display: flex; flex-direction: column; line-height: 1.25; }
.phone-text small { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: #666; font-weight: 600; }
.phone-text strong { font-size: 17px; color: var(--brand-blue); font-weight: 700; white-space: nowrap; }
@media (max-width: 1150px) { .phone-text small { display: none; } .header-phones { padding: 0 10px; } }
nav { justify-self: end; }
nav a { color: var(--brand-blue); text-decoration: none; margin-left: 25px; font-weight: 600; font-size: 17px; transition: color 0.3s; }
nav a:hover { color: var(--brand-red); }
.hero { position: relative; background-image: url('rozdzielnica.jpg'); background-size: cover; background-position: center 20%; background-repeat: no-repeat; color: #fff; padding: 60px 50px; text-align: center; border-bottom: 5px solid var(--primary-color); }
.hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.75); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 850px; margin: 0 auto; }
.hero h1 { font-size: 52px; margin-bottom: 5px; text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.95); font-weight: normal; }
.hero .company-type { font-size: 20px; color: #ccc; margin-bottom: 20px; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.95); font-weight: normal; }
.hero .subtitle { font-size: 24px; color: var(--primary-color); font-weight: 600; margin-bottom: 25px; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.95); }
.hero p { font-size: 20px; margin-bottom: 35px; text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.95); color: #f0f0f0; }
.btn { display: inline-block; background-color: var(--primary-color); color: var(--dark-color); padding: 14px 35px; text-decoration: none; font-weight: bold; font-size: 18px; border-radius: 5px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); transition: transform 0.3s, background-color 0.3s; }
.btn:hover { transform: scale(1.05); background-color: #e6b800; }
.section-title { text-align: center; font-size: 36px; margin-bottom: 10px; color: var(--brand-blue); }
.section-subtitle { text-align: center; font-size: 18px; color: #666; margin-bottom: 50px; }
.section-title::after { content: ''; display: block; width: 80px; height: 4px; background-color: var(--brand-red); margin: 10px auto 0; }
.about { padding: 80px 50px; max-width: 1000px; margin: 0 auto; text-align: center; }
.about .section-title { margin-bottom: 28px; }
.about p { font-size: 20px; color: #444; line-height: 1.9; max-width: 760px; margin: 0 auto; }
.about-lead { color: var(--brand-blue); font-weight: 600; }
.about p::after { content: ''; display: block; width: 60px; height: 3px; background-color: var(--primary-color); margin: 30px auto 0; }
.services-portal { background-color: #fff; padding: 80px 50px; border-top: 1px solid #eee; }
.services-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
@media (min-width: 1100px) {
.services-grid { grid-template-columns: repeat(6, 1fr); }
.service-box:nth-child(1) { grid-column: 1 / 3; }
.service-box:nth-child(2) { grid-column: 3 / 5; }
.service-box:nth-child(3) { grid-column: 5 / 7; }
.service-box:nth-child(4) { grid-column: 1 / 4; }
.service-box:nth-child(5) { grid-column: 4 / 7; }
.service-box:nth-child(6) { grid-column: 1 / 7; }
}
.service-box { border: 1px solid #eee; border-radius: 8px; padding: 40px 30px; position: relative; background: #fff; transition: all 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; }
.service-box:hover { border-color: var(--brand-blue); box-shadow: 0 10px 30px rgba(0,34,68,0.08); transform: translateY(-5px); }
.service-box .number { font-size: 44px; font-weight: 800; color: #f0f0f0; position: absolute; top: 15px; right: 25px; }
.service-box h3 { font-size: 22px; color: var(--brand-blue); margin-bottom: 15px; padding-right: 40px; }
.service-box p { color: #666; font-size: 16px; margin-bottom: 25px; }
.service-box .action-link { color: var(--brand-red); text-decoration: none; font-weight: bold; font-size: 15px; display: inline-flex; align-items: center; transition: color 0.2s; }
.service-box .action-link:hover { color: var(--brand-blue); }
.diagnostics { padding: 80px 50px; background-color: #f4f6f8; }
.diagnostics-container { max-width: 1200px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 4px 20px rgba(0,0,0,0.02); }
.diag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 35px; }
.diag-item { background: #f9f9f9; border-left: 4px solid var(--brand-blue); padding: 20px; border-radius: 0 8px 8px 0; }
.diag-item h4 { font-size: 17px; margin-bottom: 5px; }
.diag-item p { font-size: 14px; opacity: 0.8; }
.process { padding: 80px 50px; background: #fff; }
.process-grid { position: relative; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }
.process-grid::before { content: ''; position: absolute; top: 27px; left: 12%; right: 12%; height: 3px; background: var(--primary-color); box-shadow: 0 0 8px var(--primary-color); transform: scaleX(0); transform-origin: left; transition: transform 1.6s ease .3s; }
.process-grid.in::before { transform: scaleX(1); }
.process-step { text-align: center; position: relative; z-index: 1; }
.process-step .step-num { width: 56px; height: 56px; background: var(--brand-blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; margin: 0 auto 20px; border-bottom: 3px solid var(--primary-color); }
.process-step h3 { font-size: 20px; margin-bottom: 10px; color: var(--brand-blue); }
.process-step p { font-size: 15px; color: #666; }
.faq { padding: 80px 50px; background-color: #f4f6f8; }
.faq-container { max-width: 850px; margin: 0 auto; }
.faq-item { background: #fff; margin-bottom: 15px; border-radius: 8px; padding: 25px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.faq-item h3 { font-size: 19px; color: var(--brand-blue); margin-bottom: 10px; }
.faq-item p { font-size: 16px; color: #555; line-height: 1.7; }
.contact-portal { background-color: var(--dark-color); color: #fff; padding: 80px 50px; }
.contact-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 50px; }
.contact-details h2 { font-size: 36px; color: var(--primary-color); margin-bottom: 20px; }
.contact-details .lead { font-size: 18px; color: #ccc; margin-bottom: 35px; }
.info-card { background: rgba(255,255,255,0.05); padding: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); font-size: 18px; }
.info-card p { margin-bottom: 15px; }
.info-card a { color: var(--primary-color); text-decoration: none; font-weight: bold; }
.contact-form { background: #fff; padding: 40px; border-radius: 8px; color: var(--text-color); }
.contact-form h3 { font-size: 22px; margin-bottom: 25px; color: var(--brand-blue); text-align: center; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 15px; }
.form-group textarea { resize: none; height: 100px; }
.form-btn { width: 100%; background: var(--brand-blue); color: #fff; border: none; padding: 14px; font-size: 16px; font-weight: bold; border-radius: 4px; cursor: pointer; transition: background 0.3s; }
.form-btn:hover { background: #003366; }
footer { background-color: #111; color: #777; text-align: center; padding: 25px; font-size: 14px; border-top: 1px solid #222; }
@media (max-width: 900px) { .process-grid::before { display: none; } }
@media (max-width: 768px) {
  .about { padding: 50px 25px; } .about p { font-size: 17px; }
}
/* ===== Mobile ===== */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  header { display: flex; flex-direction: column; align-items: center; padding: 10px 16px; text-align: center; transition: padding .3s ease; }
  .logo-container { justify-self: auto; }
  .logo-img { height: 56px; transition: height .3s ease; }
  .header-phones, nav { overflow: hidden; max-height: 200px; opacity: 1; transition: max-height .35s ease, opacity .25s ease, margin .35s ease; }
  .header-phones { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; padding: 0; width: 100%; }
  .phone-pill { flex: 1 1 140px; max-width: 220px; padding-right: 10px; gap: 8px; }
  .phone-icon { width: 38px; height: 38px; }
  .phone-text strong { font-size: 14px; }
  nav { display: flex; flex-direction: column; gap: 0; width: 100%; }
  header .menu-toggle { display: flex; position: absolute; top: 12px; right: 14px; }
  header.compact .menu-toggle { top: 6px; }
  header:not(.menu-open) nav, header.compact:not(.menu-open) nav { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }
  header.menu-open nav { max-height: 300px; opacity: 1; margin-top: 8px; pointer-events: auto; }
  nav::-webkit-scrollbar { display: none; }
  nav a { margin: 0; font-size: 17px; padding: 13px 10px; border-top: 1px solid #dde3ea; }
  /* compact header after scrolling */
  header.compact { padding: 6px 16px; }
  header.compact .logo-img { height: 40px; }
  header.compact .header-phones { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }

  section { scroll-margin-top: 60px; }
  .hero { padding: 45px 20px; }
  .hero h1 { font-size: 32px; line-height: 1.2; }
  .hero .company-type { font-size: 16px; margin-bottom: 12px; }
  .hero .subtitle { font-size: 18px; margin-bottom: 18px; }
  .hero p { font-size: 16px; margin-bottom: 25px; }
  .btn { display: block; width: 100%; padding: 15px 20px; font-size: 16px; }
  .btn:hover { transform: none; }

  .section-title { font-size: 26px; line-height: 1.25; }
  .section-subtitle { font-size: 16px; margin-bottom: 30px; }
  .services-portal, .diagnostics, .process, .faq, .contact-portal { padding: 50px 18px; }
  .services-grid { grid-template-columns: 1fr; gap: 16px; }
  .service-box { padding: 24px 20px; }
  .service-box:hover { transform: none; }
  .service-box h3 { font-size: 19px; padding-right: 0; margin-bottom: 10px; }
  .service-box p { font-size: 15.5px; margin-bottom: 0; line-height: 1.65; }
  .diagnostics-container { padding: 22px 16px; }
  .diagnostics-container > p { font-size: 15.5px !important; }
  .diag-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 22px; }
  .diag-item p { font-size: 15px; }
  .process-grid { grid-template-columns: 1fr 1fr; gap: 26px 14px; }
  .process-step .step-num { width: 46px; height: 46px; font-size: 17px; margin-bottom: 12px; }
  .process-step h3 { font-size: 16.5px; }
  .process-step p { font-size: 14.5px; }
  .faq-item { padding: 18px; }
  .faq-item h3 { font-size: 17px; line-height: 1.35; }
  .faq-item p { font-size: 15.5px; }
  .contact-grid { grid-template-columns: 1fr; gap: 30px; }
  .contact-details h2 { font-size: 28px; }
  .contact-details .lead { font-size: 16px; margin-bottom: 22px; }
  .info-card { padding: 20px; font-size: 16px; word-break: break-word; }
  .contact-form { padding: 22px 18px; }
  .form-group input, .form-group textarea { font-size: 16px; } /* stops iOS zoom on focus */
  .form-btn { padding: 16px; }
}
@media (max-width: 420px) {
  .process-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
/* ===== Mobile FAQ accordion ===== */
@media (max-width: 768px) {
  .faq-item { padding: 0; overflow: hidden; }
  .faq-item h3 { margin: 0; padding: 16px 48px 16px 18px; position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
  .faq-item h3::after { content: '+'; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 400; color: var(--brand-red); transition: transform .3s ease; }
  .faq-item.open h3::after { transform: translateY(-50%) rotate(45deg); }
  .faq-item p { max-height: 0; padding: 0 18px; opacity: 0; transition: max-height .35s ease, opacity .25s ease, padding .35s ease; }
  .faq-item.open p { max-height: 600px; padding: 0 18px 18px; opacity: 1; }
}

.menu-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; padding: 10px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.menu-toggle span { display: block; height: 3px; background: var(--brand-blue); border-radius: 2px; transition: transform .25s, opacity .25s; }
header.menu-open .menu-toggle span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
header.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }
.form-group { position: relative; }

.field-error {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    color: #c62828;
    font-size: 14px;
    font-weight: 600;
    transition: max-height .25s ease, opacity .25s ease, margin .25s ease;
}
.field-error:not(:empty) { max-height: 60px; opacity: 1; margin-top: 6px; }
.field-error:not(:empty)::before { content: "⚠️ "; }

.contact-form input.invalid,
.contact-form textarea.invalid {
    border-color: #c62828;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .15);
}

.contact-form.shake { animation: shake .4s; }
@keyframes shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.form-success { text-align: center; padding: 30px 10px; }
.form-success[hidden] { display: none; }
.form-success h3 { margin: 16px 0 8px; }
.form-success.show { animation: pop .5s ease; }
@keyframes pop {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}

.success-icon {
    width: 72px; height: 72px; margin: 0 auto;
    border-radius: 50%;
    background: #2e7d32;
    display: grid; place-items: center;
}
.success-icon svg { width: 44px; height: 44px; fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.success-icon path { stroke-dasharray: 50; stroke-dashoffset: 50; }
.form-success.show .success-icon path { animation: draw .5s .25s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.contact-form .form-btn.form-btn-ghost {
    margin-top: 16px;
    background: transparent;
    color: #003366;
    border: 2px solid #003366;
}

.contact-form .form-btn.form-btn-ghost:hover {
    background: #003366;
    color: #fff;
}