* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #172c45;
  background: #f3f6fb;
}

body {
  margin: 0;
  line-height: 1.6;
}

.shell {
  width: min(100% - 2rem, 660px);
  margin: clamp(3rem, 12vh, 8rem) auto 2rem;
}

main {
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid #dbe3ed;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 40px #172c4509;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  letter-spacing: -.04em;
  line-height: 1.2;
}

h2 {
  margin: 0 0 .5rem;
  font-size: 1rem;
}

.intro {
  color: #5a6b80;
  margin: .75rem 0 2rem;
}

label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 600;
}

.form-row,
.actions {
  display: flex;
  gap: .75rem;
}

input {
  min-width: 0;
  flex: 1;
  width: 100%;
  border: 1px solid #a6b6c8;
  border-radius: 8px;
  padding: .8rem;
  font: inherit;
}

button {
  border: 1px solid #174e95;
  border-radius: 8px;
  padding: .8rem 1rem;
  background: #174e95;
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #103d78;
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

.secondary {
  background: white;
  color: #174e95;
}

.secondary:hover {
  background: #edf3fb;
}

a {
  color: #174e95;
  text-underline-offset: .2em;
}

:focus-visible {
  outline: 3px solid #518ad0;
  outline-offset: 3px;
}

#status {
  margin: 1.25rem 0 0;
}

#status:empty {
  display: none;
}

.error {
  color: #a42626;
}

#result {
  margin-top: 1.5rem;
}

#short-link {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: 1.25rem;
  flex-wrap: wrap;
  align-items: center;
}

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .9rem;
}

footer a {
  color: #5a6b80;
}

[hidden] {
  display: none !important;
}

@media (max-width: 500px) {
  .form-row {
    flex-direction: column;
  }

  .form-row button {
    width: 100%;
  }
}
