/* === FONTS === */

/* Montserrat — pełny charset (latin + polish + extended), hostowany lokalnie */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/montserrat/montserrat-300.woff2) format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/montserrat/montserrat-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/montserrat/montserrat-500.woff2) format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/montserrat/montserrat-700.woff2) format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url(fonts/montserrat/montserrat-800.woff2) format('woff2');
}

@font-face {
  font-family: 'AustinNewsDeck';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/AustinNewsDeck-Web/AustinNewsDeck-Bold-Web.woff2) format('woff2');
}

/* === RESET & VARIABLES === */

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

:root {
  --red: #C8102E;
  --red-light: #ff1a3a;
  --red-pale: #fff0f2;
  --charcoal: #1a1a1a;
  --mid: #555;
  --light: #f5f4f0;
  --border: #e0ddd6;
  --white: #ffffff;
}

/* === LAYOUT === */

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--light);
  color: var(--charcoal);
  min-height: 100vh;
  padding: 0;
}

.wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

/* === HEADER === */

.header {
  margin-bottom: 2.5rem;
}

.label-top {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.6rem;
}

h1 {
  font-family: 'AustinNewsDeck', Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--charcoal);
  margin-bottom: 0.8rem;
}

.subtitle {
  font-size: 1rem;
  color: var(--mid);
  line-height: 1.6;
  max-width: 500px;
}

/* === FORM === */

.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--mid);
  letter-spacing: 0.02em;
}

select, input[type="number"] {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s;
  outline: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

select:focus, input[type="number"]:focus {
  border-color: var(--red);
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* === RANGE SLIDER === */

.range-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.range-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]:focus {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--red);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--red);
}

/* === TOGGLE BUTTONS === */

.toggle-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.toggle {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--mid);
  cursor: pointer;
  transition: all 0.15s;
}

.toggle:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.toggle.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* === RESULTS === */

.results {
  background: var(--charcoal);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.results::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}

.results-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.5rem;
}

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

.metric {
  padding: 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
}

.metric-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  transition: all 0.3s ease;
}

.metric-value.highlight {
  color: var(--red-light);
}

.metric-unit {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255,255,255,0.4);
  margin-top: 0.2rem;
}

/* === TICKER ANIMATION === */

@keyframes countUp {
  from { opacity: 0.4; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.metric-value.updating {
  animation: countUp 0.25s ease forwards;
}

/* === PENSION BOX === */

.pension-box {
  background: rgba(200, 16, 46, 0.12);
  border: 1px solid rgba(200, 16, 46, 0.3);
  border-radius: 3px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
}

.pension-box p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.95);
  line-height: 1.6;
}

.pension-box strong {
  color: #ff4d6a;
  font-weight: 600;
}

/* === CALENDAR VISUAL === */

.clock-vis {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
}

.calendar-strip {
  display: flex;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}

.cal-day {
  width: 8px;
  height: 8px;
  border-radius: 1px;
  background: rgba(255,255,255,0.12);
  transition: background 0.05s;
}

.cal-day.free {
  background: var(--red);
}

.clock-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}


.btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  letter-spacing: 0.02em;
}

.btn:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

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

.btn-primary:hover { background: var(--red-light); }

.btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: white; }

/* === FOOTER INFO === */

.footer-info {
  margin-top: 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  color: #999;
  line-height: 1.7;
}

.footer-info p {
  margin-bottom: 0.5rem;
}

.footer-info p:last-child {
  margin-bottom: 0;
}

.footer-info .disclaimer {
  font-style: italic;
}

.footer-info .privacy-note {
  color: #bbb;
}

.footer-info a {
  color: #888;
  text-decoration: underline;
}

.footer-info a:hover {
  color: var(--charcoal);
}

/* === RESPONSIVE === */

@media (max-width: 480px) {
  .fields-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .toggle { padding: 0.6rem 1.2rem; min-height: 44px; display: inline-flex; align-items: center; }
  .btn { padding: 0.7rem 1.5rem; min-height: 44px; }
  .footer-info { font-size: 0.8rem; }
}

/* === PRINT === */

@media print {
  body { background: white; font-size: 11pt; }
  .form-section { display: none; }
  .share-box { display: none; }
  .results { background: white; color: black; border: 1px solid #ccc; }
  .results::before { display: none; }
  .results-label { color: #333; }
  .metric { background: #f5f5f5; border-color: #ccc; }
  .metric-label { color: #555; }
  .metric-value { color: black; }
  .metric-value.highlight { color: var(--red); }
  .metric-unit { color: #555; }
  .pension-box { background: #fff0f2; border-color: #ccc; }
  .pension-box p { color: #333; }
  .pension-box strong { color: var(--red); }
  .clock-vis { display: none; }
  .source-note { color: #666; }
}
