﻿/*
  Główny arkusz stylów kalkulatora SEA / RAIL.
  Sekcje poniżej grupują style dla layoutu, formularza, wyniku, toastów oraz strony historii.
*/

/* Zmienne projektu: kolory, promienie i cienie używane w całym interfejsie. */
:root {
  --primary: #be1e2d;
  --primary-dark: #9f1723;
  --primary-soft: rgba(190, 30, 45, 0.08);
  --bg: #f4f6f8;
  --bg-strong: #e9edf2;
  --card: rgba(255, 255, 255, 0.94);
  --text: #1f2937;
  --muted: #667085;
  --border: #e5e7eb;
  --line: #eef1f4;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --info-bg: #f8f9fc;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(190, 30, 45, 0.08), transparent 26%),
    radial-gradient(circle at top right, rgba(15, 23, 42, 0.06), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #f4f6f8 42%, #edf2f7 100%);
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

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

/* Główny kontener strony i centrowanie całej aplikacji. */
.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 18px 40px;
}

/* Nagłówek strony z logo i opisem narzędzia. */
.hero {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 24px;
  padding: 0 6px;
}

.hero__logos {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero__logo {
  display: block;
  width: auto;
  max-width: min(220px, 60vw);
  height: auto;
}

.hero__logo--client {
  max-width: min(190px, 52vw);
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
}

.hero__title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero__subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.main-card {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px;
}

.side-card {
  position: sticky;
  top: 20px;
  padding: 22px;
}

/* Wizualny stepper pokazujący postęp użytkownika przez 5 kroków. */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: 0.18s ease;
}

.step-chip.active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(190, 30, 45, 0.2);
}

.step-chip.done {
  color: var(--success);
  background: var(--success-bg);
  border-color: rgba(6, 118, 71, 0.18);
}

/* Kafle wyboru trybu wyceny w kroku 1. */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.tab {
  display: block;
  width: 100%;
  padding: 16px;
  color: var(--text);
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tab:hover {
  transform: translateY(-1px);
  border-color: #d0d5dd;
}

.tab.active {
  background: rgba(190, 30, 45, 0.04);
  border: 2px solid var(--primary);
}

.tab-title {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 800;
}

.tab-desc {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Karty kroków formularza z nagłówkiem, statusem i rozwijaną treścią. */
.form-section {
  margin-bottom: 16px;
  overflow: visible;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  color: inherit;
  text-align: left;
  background: #fcfcfd;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.section-header:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}

.section-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
}

.section-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.form-section.open .section-status {
  color: var(--primary);
}

.section-status.status-success {
  color: var(--success) !important;
}

.section-body {
  display: none;
  overflow: visible;
  padding: 18px;
  border-top: 1px solid var(--border);
}

.form-section.open .section-body {
  display: block;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--one {
  grid-template-columns: 1fr;
}

.details-fields,
.client-fields {
  display: none;
}

.details-fields.details-fields--visible,
.client-fields.client-fields--visible {
  display: grid;
}

.subsection-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.subsection-card__header {
  margin-bottom: 14px;
}

.subsection-card__title {
  margin-bottom: 4px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
}

.subsection-card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

/* Podstawowy wygląd pól formularza i ich komunikatów pomocniczych. */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field--full {
  grid-column: 1 / -1;
}

.field-title {
  font-size: 14px;
  font-weight: 700;
}

select,
input[type='number'],
input[type='email'],
input[type='tel'],
input[type='text'] {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

select:focus,
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(190, 30, 45, 0.1);
}

.field-error {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1) !important;
}

.error-msg {
  display: block;
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.hint {
  display: none;
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.inline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Klikalne opcje usług dodatkowych w formie pigułek. */
.pill-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.pill-option:hover {
  transform: translateY(-1px);
  border-color: rgba(190, 30, 45, 0.18);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.pill-option:has(input:checked) {
  background: rgba(190, 30, 45, 0.04);
  border-color: rgba(190, 30, 45, 0.28);
  box-shadow: 0 10px 20px rgba(190, 30, 45, 0.08);
}

.pill-option__text {
  display: inline-flex;
  align-items: center;
}

.pill-option--full {
  width: 100%;
}

.pill-option input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 0;
  accent-color: var(--primary);
}

.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 2px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  background: rgba(190, 30, 45, 0.08);
  border: 1px solid rgba(190, 30, 45, 0.14);
  border-radius: 999px;
  cursor: help;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.info-tooltip:hover,
.info-tooltip:focus-visible {
  background: rgba(190, 30, 45, 0.12);
  border-color: rgba(190, 30, 45, 0.22);
  transform: translateY(-1px);
  outline: none;
}

.info-tooltip__text {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 40;
  display: none;
  width: min(320px, calc(100vw - 32px));
  padding: 12px 14px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  white-space: pre-line;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.24);
  transform: translateX(-50%);
}

.info-tooltip__text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateX(-50%) rotate(45deg);
}

.info-tooltip:hover .info-tooltip__text,
.info-tooltip:focus-visible .info-tooltip__text {
  display: block;
}

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid #eaecf0;
  border-radius: 14px;
}

.alert.info {
  color: #344054;
  background: var(--info-bg);
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

.alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  background: rgba(190, 30, 45, 0.08);
  border-radius: 999px;
  flex-shrink: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.demo-panel {
  padding: 16px;
  background: linear-gradient(180deg, #fffdfb 0%, #ffffff 100%);
  border: 1px solid rgba(190, 30, 45, 0.12);
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.demo-panel--top {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 20px;
}

.demo-panel__header {
  margin-bottom: 14px;
}

.demo-panel__title {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.demo-panel__desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.demo-panel__list {
  display: grid;
  gap: 10px;
}

.demo-panel__list--top {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.demo-panel__button {
  display: block;
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.demo-panel__button:hover {
  background: #fffaf9;
  border-color: rgba(190, 30, 45, 0.22);
  box-shadow: 0 10px 18px rgba(190, 30, 45, 0.08);
  transform: translateY(-1px);
}

.demo-panel__button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(190, 30, 45, 0.1);
}

.demo-panel__button[disabled] {
  cursor: wait;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* Wspólny system przycisków używany w całej aplikacji. */
.btn {
  min-height: 50px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #cf2232 0%, #be1e2d 100%);
  box-shadow: 0 10px 18px rgba(190, 30, 45, 0.18);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn[disabled] {
  cursor: wait;
  opacity: 0.78;
}

.btn-primary.is-loading {
  position: relative;
  padding-left: 46px;
}

.btn-primary.is-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 18px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: buttonSpin 0.7s linear infinite;
}

.btn-secondary,
.btn-reset {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-reset:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.pol-dropdown {
  position: relative;
}

.pol-dropdown__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  box-shadow: none;
}

.pol-dropdown__trigger:hover {
  transform: none;
  filter: none;
  border-color: #bfc5ce;
}

.pol-dropdown__trigger--open {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(190, 30, 45, 0.1);
}

.pol-dropdown__trigger--error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.1) !important;
}

.pol-dropdown__arrow {
  color: var(--muted);
  font-size: 11px;
  transition: transform 0.18s ease;
}

.pol-dropdown__arrow--open {
  transform: rotate(180deg);
}

.pol-dropdown__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
  max-height: 260px;
  padding: 8px 0;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.pol-dropdown__menu--open {
  display: block;
}

.pol-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.pol-dropdown__item:hover {
  background: #f8fafc;
}

.pol-dropdown__item input[type='checkbox'] {
  width: 16px !important;
  height: 16px !important;
  min-height: auto !important;
  margin: 0 !important;
}

.pol-dropdown__item label {
  flex: 1;
  cursor: pointer;
}

.result {
  min-height: 40px;
}

.result:empty {
  display: none;
}

/* Główna karta prezentująca wynik wyceny ALL-IN. */
.result-box {
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdfc 100%);
  border: 1px solid rgba(6, 118, 71, 0.18);
  border-radius: 18px;
}

.result-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.result-title {
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(190, 30, 45, 0.08);
  border: 1px solid rgba(190, 30, 45, 0.14);
  border-radius: 999px;
}

.result-value {
  margin: 6px 0 10px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.1;
}

.result-caption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.result-validity {
  position: relative;
  min-width: 190px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fff7f8 0%, #fffdfd 100%);
  border: 1px solid rgba(190, 30, 45, 0.16);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.result-validity::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 4px;
  height: calc(100% - 28px);
  background: rgba(190, 30, 45, 0.38);
  border-radius: 999px;
}

.result-validity__label {
  display: block;
  margin-bottom: 6px;
  padding-left: 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-validity__value {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  padding-left: 12px;
}

.result-note,
.result-note-multi,
.result-disclaimer {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.result-disclaimer {
  position: relative;
  margin-top: 16px;
  padding: 16px 18px 16px 52px;
  color: #4b5563;
  background: linear-gradient(180deg, #fcfcfd 0%, #f8fafc 100%);
  border: 1px solid #e7ecf3;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.result-disclaimer::before {
  content: 'i';
  position: absolute;
  top: 17px;
  left: 18px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.result-reference {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.result-reference__label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-reference__value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  font-size: 12px;
  word-break: break-all;
}

.result-reference--error {
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.result-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 16px;
}

.quote-params-pill {
  margin-bottom: 16px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid rgba(190, 30, 45, 0.14);
  border-radius: 16px;
}

.quote-params-pill__title {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

.quote-params-pill__row {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.quote-params-pill__row strong {
  color: var(--text);
}

.result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
  align-items: start;
}

.result-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.result-card--best {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, #fffafb 0%, #ffffff 100%);
  box-shadow: 0 18px 34px rgba(190, 30, 45, 0.12);
  transform: translateY(-2px);
}

.result-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: var(--primary);
  border-radius: 999px;
}

.result-card--best .result-card__badge {
  box-shadow: 0 10px 20px rgba(190, 30, 45, 0.18);
}

.result-card__route {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
}

.result-card__value {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
}

.result-card--best .result-card__value {
  color: var(--primary-dark);
}

.result-card__meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.result-card--best .result-card__meta {
  color: #5b2230;
}

.result-card--active {
  border-color: var(--primary);
  box-shadow: 0 14px 30px rgba(190, 30, 45, 0.12);
}

.result-card__toggle {
  margin-top: 12px;
  padding: 8px 10px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  background: rgba(190, 30, 45, 0.08);
  border: 1px solid rgba(190, 30, 45, 0.2);
  border-radius: 10px;
  cursor: pointer;
}

.result-card__details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #d0d5dd;
}

.result-card__details-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  color: #344054;
  font-size: 13px;
}

.result-card__details-row strong {
  color: #111827;
  font-weight: 800;
}

.result-card__details-row--muted {
  color: #667085;
}

.result-card__details-empty {
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
}

.transit-time {
  margin-top: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
}

.transit-time__title {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.transit-time__subtitle {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.transit-time__row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #d7dee8;
}

.transit-time__cell {
  color: #344054;
  font-size: 12px;
  line-height: 1.5;
}

.transit-time__cell--label {
  color: #111827;
  font-weight: 800;
}

.result-error {
  margin: 0;
  padding: 18px;
  background: linear-gradient(180deg, #fff7f7 0%, #fffdfd 100%);
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-left: 4px solid var(--danger);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(180, 35, 24, 0.06);
}

.result-error__title {
  margin-bottom: 6px;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

.result-error__text {
  color: #6b1f17;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.side-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 800;
}

.mini-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.mini-step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mini-step-no {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  background: rgba(190, 30, 45, 0.1);
  border-radius: 999px;
  flex-shrink: 0;
}

.mini-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.mini-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 960px) {
  .result-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .result-validity {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions .btn,
  .result-actions .btn {
    width: 100%;
  }

  .pill-option {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Stos toastów w prawym górnym rogu do miękkich komunikatów. */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10020;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  padding: 14px 16px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid var(--success);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(10px);
  transform: translateY(-8px);
  opacity: 0;
  animation: toastIn 0.22s ease forwards;
}

.toast--info {
  border-left-color: var(--primary);
}

.toast--success {
  border-left-color: var(--success);
}

.toast__title {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 800;
}

.toast__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast.is-leaving {
  animation: toastOut 0.2s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes buttonSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal__box {
  width: 620px;
  max-width: 92vw;
  padding: 28px 30px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal__title {
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.modal__text {
  margin-bottom: 22px;
  color: #334155;
  font-size: 16px;
  line-height: 1.65;
  text-align: center;
  white-space: pre-line;
}

.modal__button {
  width: 100%;
  min-height: 50px;
  color: #fff;
  background: #0f172a;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

.modal__button:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-card {
    position: static;
  }

  .tabs,
  .grid--two {
    grid-template-columns: 1fr;
  }

  .demo-panel__list--top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .result-validity {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 18px 12px 28px;
  }

  .main-card,
  .side-card {
    padding: 16px;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-status {
    text-align: left;
  }

  .actions .btn {
    width: 100%;
  }

  .demo-panel--top {
    margin-bottom: 16px;
  }

  .demo-panel__list--top {
    grid-template-columns: 1fr;
  }

  .toast-stack {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}



.result-breakdown {
  margin-top: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #fffaf6 0%, #fff 100%);
  border: 1px dashed rgba(190, 30, 45, 0.2);
  border-radius: 16px;
}

.result-breakdown__title {
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-breakdown__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  font-size: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.result-breakdown__row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.result-breakdown__row strong {
  color: #111827;
}

.result-breakdown__row--subtotal,
.result-breakdown__row--margin {
  font-weight: 800;
}

.result-breakdown__row--margin {
  color: var(--primary);
}
