/* Author: Robert Pardela (AI) */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5c6b82;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #059669;
  --success-light: #d1fae5;
  --classic: #64748b;
  --classic-light: #f1f5f9;
  --ai: #7c3aed;
  --ai-light: #ede9fe;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

.header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
  flex-wrap: wrap;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.header__titles {
  min-width: 0;
}

.header h1 {
  margin: 0 0 0.15rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.5rem 0.32rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.locale-switcher:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.locale-switcher__icon {
  font-size: 1rem;
  line-height: 1;
}

/* Etykieta dostępna dla czytników ekranu, ukryta wizualnie */
.locale-switcher__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.locale-switcher__select {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.2rem 1.5rem 0.2rem 0.15rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235c6b82' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  background-size: 0.7rem;
}

.locale-switcher__select:focus {
  outline: none;
}

@media (max-width: 560px) {
  .header {
    padding: 1.1rem 1.15rem;
  }

  .header__top {
    align-items: flex-start;
  }

  .header__actions {
    width: 100%;
    justify-content: space-between;
  }
}

.main {
  flex: 1;
}

.hidden {
  display: none !important;
}

.payment-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.payment-status h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
}

.payment-status__message {
  margin: 0;
  color: var(--text-muted);
}

.payment-status__actions {
  margin-top: 1.25rem;
}

.loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.estimate-processing {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.estimate-processing__title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  color: var(--text);
}

.estimate-processing__message {
  margin: 0;
  max-width: 36rem;
  margin-inline: auto;
  color: var(--text-muted);
  line-height: 1.6;
}

.error-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.wizard {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.step-indicator {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
}

.currency-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--classic-light);
}

.currency-picker__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.currency-picker__select {
  min-width: 5.75rem;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.currency-picker__select:focus {
  outline: 2px solid var(--primary-light);
  border-color: var(--primary);
}

.step-container h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.step-description {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.step-context {
  margin: -0.75rem 0 1.25rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text);
  font-size: 0.95rem;
}

.question-block {
  margin-bottom: 1.75rem;
}

.question-block:last-child {
  margin-bottom: 0;
}

.question-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.question-required {
  color: #dc2626;
}

.options-grid {
  display: grid;
  gap: 0.75rem;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}

.option-card:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}

.option-card--selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-card input {
  margin-top: 0.2rem;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.option-card__content {
  flex: 1;
}

.option-card__label {
  font-weight: 600;
  display: block;
}

.option-card__hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.text-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s;
}

.text-input--description {
  min-height: 280px;
  line-height: 1.6;
  padding: 1rem 1.125rem;
}

.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

.validation-hint {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.char-counter {
  color: var(--text-muted, #64748b);
  font-size: 0.8125rem;
  margin-top: 0.375rem;
  text-align: right;
}

.char-counter--over {
  color: #dc2626;
  font-weight: 600;
}

.wizard__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn--secondary {
  background: var(--classic-light);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--border);
}

.results__hero {
  text-align: center;
  margin-bottom: 2rem;
}

.results__hero h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.panel--report-section {
  border: 1px solid var(--border);
  background: var(--surface-muted, #f8f9fb);
}

.results-answers {
  margin: 0 0 1.25rem;
}

.results-answers__row + .results-answers__row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.results-answers__row dt {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.results-answers__row dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.results-user-field + .results-user-field {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.results-user-field h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.results-user-field__value {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

.results-user-field__value--multiline {
  white-space: pre-wrap;
}

.results-ai-scope {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.cost-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .cost-cards {
    grid-template-columns: 1fr;
  }
}

.cost-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
}

.cost-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.cost-card--classic {
  background: var(--classic-light);
  border: 1px solid var(--border);
}

.cost-card--ai {
  background: var(--ai-light);
  border: 2px solid var(--ai);
}

.cost-card__amount {
  font-size: 2rem;
  font-weight: 800;
  margin: 0.25rem 0;
  letter-spacing: -0.02em;
}

.cost-card--classic .cost-card__amount {
  color: var(--classic);
}

.cost-card--ai .cost-card__amount {
  color: var(--ai);
}

.cost-card__note {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.results__section-heading {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.results__delivery-section {
  margin-top: 1.5rem;
}

.results__email-notice {
  text-align: center;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.results__offer-validity {
  text-align: center;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: #fff4e5;
  color: #8a4b00;
  font-weight: 600;
}

.results__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results__grid .panel--full-width {
  grid-column: 1 / -1;
}

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

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.panel h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.panel--disclaimer {
  background: var(--surface-muted, #f8f9fb);
}

.panel--consistency-warnings {
  background: #fff8e6;
  border: 1px solid #f0d58a;
}

.consistency-warnings-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #7a5b00;
  font-size: 0.875rem;
  line-height: 1.55;
}

.consistency-warnings-list li + li {
  margin-top: 0.5rem;
}

.disclaimer-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.disclaimer-list li + li {
  margin-top: 0.5rem;
}

.breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.breakdown-list li:last-child {
  border-bottom: none;
}

.breakdown-list__value {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  margin-left: 1rem;
}

.phases-table {
  overflow-x: auto;
}

.phases-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.phases-table th,
.phases-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.phases-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.phases-table td:last-child,
.phases-table th:last-child {
  text-align: right;
}

.savings-positive {
  color: var(--success);
  font-weight: 600;
}

.results__actions {
  text-align: center;
  margin-top: 1.5rem;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer p {
  margin: 0;
}

.footer a {
  color: inherit;
}

.footer span {
  margin: 0 0.35rem;
}

.access-gate {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
}

.access-gate__description {
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.text-input--single {
  min-height: auto;
  resize: vertical;
}

.access-gate__success {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--success-light);
  color: var(--success);
  font-weight: 600;
}
