* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 620px);
  background: #ffffff;
  border-radius: 22px;
  padding: 34px;
  box-shadow: 0 18px 55px rgba(23, 32, 51, 0.12);
}

.icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  background: #eef4ff;
  font-size: 30px;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0 0 30px;
  color: #667085;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

label {
  font-weight: 700;
  font-size: 0.94rem;
}

input[type="date"] {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #ffffff;
  color: #172033;
  font: inherit;
}

input[type="date"]:focus {
  outline: 3px solid rgba(45, 106, 224, 0.16);
  border-color: #2d6ae0;
}

input:disabled {
  background: #f2f4f7;
  color: #667085;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

#calculateBtn {
  flex: 1;
  background: #2d6ae0;
  color: #ffffff;
}

#calculateBtn:hover {
  background: #245bc2;
}

.secondary {
  background: #eef1f5;
  color: #344054;
}

.secondary:hover {
  background: #e3e7ed;
}

.result {
  margin-top: 28px;
  padding: 24px;
  border-radius: 16px;
  background: #f7f9fc;
  border: 1px solid #e5eaf1;
  text-align: center;
}

.result-label,
.days-text {
  display: block;
  color: #667085;
}

.days-number {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(3.2rem, 12vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff1f1;
  color: #b42318;
  font-weight: 600;
}

.hidden {
  display: none;
}

@media (max-width: 560px) {
  .card {
    padding: 24px;
    border-radius: 18px;
  }

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

  .actions {
    flex-direction: column;
  }
}
