/* latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0D0D0D;
  --text: #E0E0E0;
  --green: #00FF41;
  --red: #C0392B;
  --yellow: #F39C12;
  --code-bg: #1A1A1A;
  --card-bg: #141414;
  --font: 'JetBrains Mono', monospace;
  --max-w: 720px;
}

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

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

h1 {
  font-weight: 800;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
}

h2 {
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.3;
  color: #fff;
  margin-bottom: 1.5rem;
}

p {
  margin-bottom: 1.2rem;
}

strong {
  color: #fff;
  font-weight: 700;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

pre {
  background: var(--code-bg);
  padding: 20px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 1.5rem 0;
}

code {
  font-family: var(--font);
}

.calc-input label {
  display: block;
  margin-bottom: 0.75rem;
  color: #999;
  font-size: 14px;
}

.calc-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.calc-row input {
  background: var(--code-bg);
  border: 1px solid #333;
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  padding: 12px 16px;
  border-radius: 4px;
  width: 160px;
  transition: border-color 0.2s;
}

.calc-row input:focus {
  border-color: var(--green);
}

.calc-row button {
  background: var(--green);
  color: var(--bg);
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.calc-row button:hover {
  opacity: 0.85;
}

.calc-result {
  margin-top: 2rem;
  text-align: center;
}

.odometer {
  display: block;
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 800;
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.calc-subtitle {
  color: #999;
  font-size: 14px;
  margin-top: 0.5rem;
}

.calc-message {
  font-size: 16px;
  font-weight: 700;
  margin-top: 1rem;
}

.datepicker-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}

.datepicker {
  background: #1E1E1E;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  width: 320px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.datepicker.native-datepicker {
  padding: 20px;
}

.dp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dp-arrow {
  background: none;
  border: 1px solid #444;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.dp-arrow:hover {
  background: #333;
}

.dp-month-year {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dp-day {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 0;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}

.dp-day:hover {
  background: #333;
}

.dp-day.empty {
  cursor: default;
}

.dp-day.empty:hover {
  background: none;
}

.dp-stats {
  text-align: center;
  font-size: 14px;
}

.dp-stats strong {
  color: var(--yellow);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.dp-message {
  color: var(--yellow);
  font-size: 14px;
  min-height: 1.5em;
  margin-top: 0.5rem;
  transition: opacity 0.3s;
}

.btn-desisto {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-desisto:hover {
  background: var(--red);
  color: #fff;
}

.dp-outro {
  text-align: center;
  font-weight: 700;
  color: var(--red);
  margin-top: 2rem;
  font-size: 16px;
}

.solution-demo {
  margin: 2rem 0;
  padding: 24px;
  background: var(--code-bg);
  border-radius: 8px;
}

.solution-fields {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
}

.solution-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.solution-field label {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
}

.solution-field input {
  background: var(--bg);
  border: 2px solid #333;
  color: var(--text);
  font-family: var(--font);
  font-size: 24px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  width: 80px;
  transition: border-color 0.3s;
}

.solution-field input.valid {
  border-color: var(--green);
}

.solution-field input:focus {
  border-color: var(--green);
}

.solution-field input[maxlength="4"] {
  width: 120px;
}

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

.solution-result p:first-child {
  font-size: 18px;
  color: #fff;
  font-weight: 700;
}

.solution-msg {
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}

/* Popover date picker demo */
.popover-picker {
  background: #1E1E1E;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  width: 320px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  position: relative;
}

.pp-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pp-label {
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}

.pp-label:hover {
  background: #333;
}

.pp-popover {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: #1E1E1E;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.pp-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.pp-month-item {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 4px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
}

.pp-month-item:hover {
  background: #333;
}

.pp-years-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pp-years-list::-webkit-scrollbar {
  width: 6px;
}

.pp-years-list::-webkit-scrollbar-track {
  background: transparent;
}

.pp-years-list::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.pp-year-item {
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s;
  flex-shrink: 0;
}

.pp-year-item:hover {
  background: #333;
}

.pp-result {
  text-align: center;
}

.pp-result p {
  color: var(--yellow);
  font-weight: 700;
  font-size: 14px;
}

/* Native dropdown demo */
.native-selects {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-end;
}

.native-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.native-field label {
  font-size: 12px;
  color: #999;
  text-transform: uppercase;
}

.native-select {
  background: var(--bg);
  border: 1px solid #444;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  padding: 10px 28px 10px 10px;
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.native-select:focus {
  border-color: var(--text);
}

.native-select option {
  background: #1E1E1E;
  color: var(--text);
}

.nd-result {
  text-align: center;
}

.nd-result p {
  color: var(--yellow);
  font-weight: 700;
  font-size: 14px;
}

.shame-card {
  border-left: 3px solid var(--red);
  padding: 20px 24px;
  margin-bottom: 16px;
  background: var(--card-bg);
  border-radius: 0 4px 4px 0;
}

.shame-card h3 {
  color: var(--red);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.shame-card p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.7;
}

.dp-desistiu {
  text-align: center;
  color: var(--red);
  font-weight: 700;
  font-size: 16px;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.share-btn:hover {
  background: var(--green);
  color: var(--bg);
  text-decoration: none;
}

#hero {
  padding-top: 120px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#hero h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  margin-bottom: 2rem;
}

.fade-target {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

#hero.fade-target {
  opacity: 1;
  transform: none;
}

.fade-target.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .section {
    padding: 48px 0;
  }

  .container {
    padding: 0 16px;
  }

  #hero {
    padding-top: 60px;
    min-height: auto;
  }

  .calc-row {
    flex-direction: column;
    align-items: stretch;
  }

  .calc-row input {
    width: 100%;
  }

  .datepicker,
  .popover-picker {
    width: 100%;
    max-width: 320px;
  }

  .native-selects {
    flex-wrap: wrap;
  }

  .solution-fields {
    flex-direction: row;
    gap: 8px;
  }

  .solution-field input {
    font-size: 18px;
    padding: 8px;
    width: 64px;
  }

  .solution-field input[maxlength="4"] {
    width: 96px;
  }

  .share-links {
    flex-direction: column;
  }

  .share-btn {
    text-align: center;
    justify-content: center;
  }
}
