/* nFirma Tax — wersja "kancelaria"
   Light theme: cream + navy + gold (Coutts bank vibe)
   Brand colors zachowane: gold #C5A55A + navy #2D2D4F (z brief-redesign-logo.md)
   Typografia: serif h1 (Georgia stack) + sans-serif body (Inter/system)
*/

:root {
  /* Tła i powierzchnie */
  --bg: #FAFAF7;            /* cream off-white, "kartka papieru" */
  --surface: #FFFFFF;       /* białe karty na cream tle */
  --surface-soft: #F5F2EA;  /* delikatny cream akcent */
  --header-bg: #2D2D4F;     /* navy header utrzymuje autorytet */
  --footer-bg: #1F1F38;     /* ciemniejszy navy w footerze */

  /* Tekst */
  --text: #1A1A2E;          /* navy jako kolor tekstu, nie tła */
  --text-soft: #4A4A66;
  --muted: #7A7A8C;

  /* Akcenty */
  --gold: #C5A55A;
  --gold-dark: #A88940;
  --gold-soft: rgba(197, 165, 90, 0.12);
  --navy: #2D2D4F;
  --navy-dark: #1A1A2E;

  /* Bordery i divider */
  --border: #E5E0D0;        /* ciepły beż */
  --border-soft: #EFEBE0;
  --divider: #D4CDB8;

  /* Status */
  --error: #B23B3B;
  --error-bg: #FBEFEF;
  --info: #5A6FA0;

  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

/* Natywny atrybut hidden musi wygrać z custom display: flex/inline-flex/grid */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gold-dark); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--navy); text-decoration: underline; }

/* ===== HEADER (navy, autorytet) ===== */
.site-header {
  background: var(--header-bg);
  border-bottom: 2px solid var(--gold);
  padding: 14px 24px;
}
.site-header-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--gold);
}
.brand-mark::before {
  content: "n";
  background: var(--gold);
  color: var(--navy-dark);
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 4px;
  font-weight: 900;
}
.brand-mark-name { color: #FFFFFF; font-weight: 700; }
.brand-tag {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.site-nav {
  display: flex;
  gap: 16px;
  font-size: 13.5px;
  align-items: center;
}
.site-nav a {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  letter-spacing: 0.2px;
}
.site-nav a:hover { color: var(--gold); text-decoration: none; }

/* Header auth button */
.auth-btn {
  background: var(--gold);
  color: var(--navy-dark);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.2px;
}
.auth-btn:hover { background: #d9b964; }

.auth-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}
.auth-user #auth-user-email {
  color: var(--gold);
  font-weight: 500;
}
.auth-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.75);
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
}
.auth-logout:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}

/* ===== MAIN ===== */
.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== HERO ===== */
.hero {
  margin-bottom: 36px;
  text-align: center;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--gold-dark);
  margin: 0 0 16px;
  font-weight: 600;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--navy);
  font-weight: 600;
  font-family: ui-serif, Georgia, "Iowan Old Style", "Apple Garamond", "Source Serif Pro", "Times New Roman", serif;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold-dark);
}
.lead {
  color: var(--text-soft);
  margin: 0 auto;
  font-size: 16.5px;
  max-width: 540px;
  line-height: 1.55;
}

/* ===== KARTA FORMULARZA ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(45, 45, 79, 0.04);
}
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 14px 16px;
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.55;
}
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
textarea::placeholder {
  color: var(--muted);
}

.input-hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.input-hint kbd {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--navy);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 12px;
}
.counter {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ===== BUTTONS ===== */
button {
  background: var(--navy);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
  letter-spacing: 0.2px;
}
button:hover { background: var(--navy-dark); }
button:active { transform: translateY(1px); }
button:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* ===== TRUST STRIP ===== */
.trust-strip {
  margin: 32px auto 0;
  padding: 18px 24px;
  background: transparent;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  gap: 24px;
  flex-wrap: wrap;
  text-align: center;
}
.trust-cell {
  flex: 1;
  min-width: 140px;
}
.trust-num {
  display: block;
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}
.trust-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

/* ===== FAQ ACCORDION ===== */
.faq-section {
  margin: 56px 0 0;
}
.faq-section h2 {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 22px;
  color: var(--navy);
  margin: 0 0 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.faq-item:hover { border-color: var(--divider); }
.faq-item[open] { border-color: var(--gold); }
.faq-summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--navy);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary::after {
  content: "+";
  font-size: 22px;
  color: var(--gold-dark);
  font-weight: 400;
  margin-left: 12px;
  transition: transform 0.2s;
}
.faq-item[open] .faq-summary::after {
  content: "−";
}
.faq-body {
  padding: 0 18px 18px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.65;
}
.faq-body p { margin: 0 0 12px; }
.faq-body p:last-child { margin: 0; }
.faq-body ul { margin: 8px 0; padding-left: 20px; }
.faq-body li { margin-bottom: 6px; }
.faq-body code {
  background: var(--surface-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--navy);
}

/* ===== RESULTS ===== */
.results {
  margin-top: 36px;
  display: grid;
  gap: 12px;
}
.rec {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rec:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 8px rgba(197, 165, 90, 0.1);
}
.rec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.rec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  font-family: ui-serif, Georgia, serif;
}
.rec-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
}
.rec-link {
  color: var(--gold-dark);
  font-size: 13px;
  margin-left: auto;
  font-weight: 500;
}
.rec-link:hover { color: var(--navy); }
.rec-why {
  margin: 8px 0 0 38px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ===== DISCLAIMER (prominentny) ===== */
.disclaimer {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--surface-soft);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.55;
}
.disclaimer strong { color: var(--navy); }

/* ===== CTA do nFirma ===== */
.cta-consult {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(45, 45, 79, 0.04);
}
.cta-consult-text {
  flex: 1;
  min-width: 240px;
}
.cta-consult h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: var(--navy);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 600;
}
.cta-consult p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.5;
}
.cta-consult-btn {
  background: var(--navy);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.cta-consult-btn:hover {
  background: var(--navy-dark);
  color: var(--gold);
  text-decoration: none;
}

/* ===== ERROR / LOADING ===== */
.error {
  background: var(--error-bg);
  border: 1px solid #ECBABA;
  color: var(--error);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
}
.loading {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  padding: 28px;
  font-style: italic;
}

/* ===== HISTORY ===== */
.history {
  margin-top: 48px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.history-head h2 {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.ghost-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
}
.ghost-btn:hover {
  border-color: var(--error);
  color: var(--error);
  background: transparent;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.history-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
}
.history-q {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}
.history-meta {
  color: var(--muted);
  font-size: 11.5px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== FOOTER (navy ciemny, professional) ===== */
.site-footer {
  margin-top: 80px;
  padding: 36px 24px 24px;
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
}
.site-footer-inner {
  max-width: 920px;
  margin: 0 auto;
}
.site-footer-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}
.site-footer-brand {
  flex: 1;
  min-width: 220px;
}
.site-footer-brand strong {
  color: var(--gold);
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.site-footer-brand p {
  margin: 0 0 4px;
  line-height: 1.55;
}
.site-footer-meta {
  text-align: right;
  min-width: 220px;
}
.site-footer-meta p { margin: 0 0 4px; }
.site-footer-meta code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
.site-footer-badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.site-footer-badges .badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}
.site-footer-badges .badge-sep {
  color: rgba(255, 255, 255, 0.3);
}

.site-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.5);
}
.site-footer-bottom a {
  color: rgba(255, 255, 255, 0.7);
}
.site-footer-bottom a:hover { color: var(--gold); text-decoration: none; }
.site-footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== AUTH MODAL ===== */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal[hidden] { display: none; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.55);
  backdrop-filter: blur(3px);
}
.auth-modal-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(26, 26, 46, 0.25);
  animation: authPopIn 0.2s ease-out;
}
@keyframes authPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
}
.auth-modal-close:hover {
  background: var(--surface-soft);
  color: var(--navy);
}

.auth-modal h2 {
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: -0.3px;
}
.auth-eyebrow {
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 1.8px;
  color: var(--gold-dark);
  margin: 0 0 10px;
  font-weight: 600;
}
.auth-lead {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
}
.auth-lead strong { color: var(--navy); }

.auth-modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-modal input[type="email"],
.auth-modal input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-modal input[type="email"]:focus,
.auth-modal input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
#auth-code-input {
  font-family: ui-serif, Georgia, serif;
  font-size: 22px;
  letter-spacing: 10px;
  text-align: center;
  font-weight: 600;
  color: var(--navy);
}
.auth-modal button[type="submit"] {
  background: var(--navy);
  color: #FFF;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-modal button[type="submit"]:hover { background: var(--navy-dark); }
.auth-modal button[type="submit"]:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.auth-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--error-bg);
  border: 1px solid #ECBABA;
  color: var(--error);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}

.auth-back {
  margin-top: 12px;
  background: transparent;
  border: 0;
  color: var(--gold-dark);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.auth-back:hover { color: var(--navy); text-decoration: underline; }

/* ===== PROFILE WIZARD ===== */
.profile-panel {
  max-width: 500px;
}
.profile-field {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
.profile-field legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  padding: 0;
}
.profile-field input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  padding: 10px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-field input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}
.profile-pill:hover {
  border-color: var(--gold);
  color: var(--navy);
}
.profile-pill.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #FFF;
}
.profile-pill.selected:hover {
  background: var(--navy-dark);
  color: #FFF;
}

#profile-submit {
  width: 100%;
  background: var(--navy);
  color: #FFF;
  border: 0;
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}
#profile-submit:hover { background: var(--navy-dark); }
#profile-submit:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.personalized-badge {
  display: inline-block;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-left: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .shell { padding: 36px 18px 36px; }
  .hero h1 { font-size: 28px; }
  .lead { font-size: 15px; }
  .site-header { padding: 12px 18px; }
  .brand-tag { display: none; }
  .trust-cell { min-width: 100px; }
  .trust-num { font-size: 20px; }
  .cta-consult { flex-direction: column; align-items: flex-start; }
  .cta-consult-btn { width: 100%; text-align: center; }
  .site-footer-top { flex-direction: column; }
  .site-footer-meta { text-align: left; }
}
