* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

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

  display: flex;
  justify-content: center;
  align-items: center;

  background: whitesmoke;
  font-family: sans-serif;
}

.container {
  width: 100%;
  max-width: 760px;
  padding: 1rem;
}

/* FORM */
.url-form {
  background: white;

  padding: 1.5rem;

  border: 1px solid #ddd;
  border-radius: 1rem;

  display: grid;
  gap: 1.25rem;
}

/* FIELD */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;

  width: 100%;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
}

/* INPUTS */
input,
select,
button,
.short-box {
  height: 44px;

  border: 1px solid #ccc;
  border-radius: 0.5rem;

  padding: 0 0.75rem;

  font-size: 1rem;
}

/* TOP ROW */
.main-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 0.75rem;
  align-items: end;
}

/* RESULT */
.result-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
  align-items: start;
}

/* full width top row */
.result-grid .full {
  grid-column: 1 / -1;
}

/* left column stacks short url + token */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}

/* .left-col { */
/* margin-top: auto; */
/* } */

/* right column (QR centered nicely) */
.right-col {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-right: 0;
  /* ensure no extra spacing */
}

.right-col .field label {
  width: 100%;
  text-align: center;
}

/* make QR visually centered in its half */
.qr {
  /* width: clamp(10rem, 10rem, 10rem); */
  align-self: self-end;
  width: 10rem;
  margin-top: 0.25rem;
}

.long-box {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;

  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;

  border: 1px solid #ccc;
  border-radius: 0.5rem;

  padding: 0.75rem;

  line-height: 1.4;
  overflow-wrap: anywhere;

  margin-bottom: 8px;
}

.short-box {
  display: flex;
  align-items: center;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* OPTIONS */
.options {
  border: 1px solid #ddd;
  border-radius: 0.75rem;

  padding: 1rem;

  display: grid;
  gap: 1rem;
}

.options legend {
  font-weight: bold;
  padding: 0 0.5rem;
}

/* GRID ROWS */
.exp-uses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

/* ERROR */
.error {
  font-size: 1rem;
  font-weight: 600;
  color: crimson;
}

/* BUTTON */
.button-field button {
  width: 120px;
  cursor: pointer;
}

/* TOGGLE SWITCH */
.checkbox-field label.switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  cursor: pointer;
  user-select: none;

  font-size: 1rem;
  font-weight: 500;
}

.switch input {
  display: none;
}

.slider {
  width: 44px;
  height: 24px;

  background: #ccc;
  border-radius: 999px;

  position: relative;

  transition: 0.2s;
}

.slider::before {
  content: "";

  position: absolute;
  top: 3px;
  left: 3px;

  width: 18px;
  height: 18px;

  background: white;
  border-radius: 50%;

  transition: 0.2s;

  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked+.slider {
  background: #333;
}

.switch input:checked+.slider::before {
  transform: translateX(20px);
}

/* TOKEN CARD */
.token-card {
  margin-top: 1.5rem;

  background: white;

  border: 1px solid #ddd;
  border-radius: 1rem;

  padding: 1.5rem;

  display: grid;
  gap: 1rem;
}

.token-card legend {
  font-weight: bold;
  padding: 0 0.5rem;
}