:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: #171926;
  background: #fbfaf7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fbfaf7;
}

button,
textarea,
select {
  font: inherit;
}

.tool {
  width: min(100%, 1040px);
  margin: auto;
  padding: clamp(20px, 4vw, 40px);
}

.tool__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #4b47a8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h2,
h3,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: #626578;
  line-height: 1.6;
}

.privacy {
  flex: none;
  padding: 7px 10px;
  border-radius: 999px;
  color: #175d72;
  background: #e6f7fb;
  font-size: 0.78rem;
  font-weight: 750;
}

form,
.result {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #dddde5;
  border-radius: 18px;
  background: #fff;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

textarea {
  display: block;
  width: 100%;
  min-height: 270px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #babdca;
  border-radius: 12px;
  color: inherit;
  background: #fff;
  line-height: 1.55;
}

textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgb(77 70 180 / 28%);
  outline-offset: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 16px;
  margin-top: 18px;
}

.select-label {
  margin: 0;
}

.select-label span {
  display: block;
  margin-bottom: 7px;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 8px 38px 8px 12px;
  border: 1px solid #babdca;
  border-radius: 10px;
  background: #fff;
}

.length {
  align-self: center;
  color: #6b6e7e;
  font-size: 0.82rem;
}

button {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: #403aa1;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: #302b80;
}

button.secondary {
  color: #403aa1;
  background: #efeffb;
}

.error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #b42318;
  color: #7a271a;
  background: #fff3f2;
}

.result {
  margin-top: 18px;
}

.result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result__header h3 {
  margin-bottom: 0;
  font-size: 1.3rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
}

.metrics > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #e5e5eb;
  border-radius: 12px;
  background: #fafafd;
}

dt {
  color: #686b7b;
  font-size: 0.82rem;
}

dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 850;
}

.copy-status {
  min-height: 20px;
  margin: 10px 0 0;
  color: #626578;
  font-size: 0.84rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .tool__header {
    display: grid;
  }

  .privacy {
    justify-self: start;
  }

  .form-row,
  .metrics {
    grid-template-columns: 1fr;
  }

  .length {
    justify-self: start;
  }

  button {
    width: 100%;
  }
}
