* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background: #0f172a;
  color: #e5e7eb;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.title {
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
  line-height: 1.2;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 15px;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #374151;
  background: #020617;
  color: #fff;
  font-size: 16px;
}

.btn {
  width: 100%;
  padding: 14px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn:hover {
  background: #1d4ed8;
}

.hidden {
  display: none;
}

/* ---------- Форми ---------- */

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.form-row .field {
  min-width: 0;
}

.form-row-2 .field {
  flex: 1 1 50%;
}

.form-row-2-1 .field:first-child {
  flex: 2 1 66.666%;
}

.form-row-2-1 .field:last-child {
  flex: 1 1 33.333%;
}

.form-row-3 {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.form-row-3 .field {
  flex: 1 1 33.333%;
  min-width: 0;
}

#createBtn {
  margin-top: 10px;
}

/* ---------- Результат ---------- */

.result-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.result-row input {
  flex: 1;
}

.btn-small {
  width: auto;
  min-width: 140px;
  padding: 12px 16px;
  white-space: nowrap;
}

.result-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-top: 16px;
}

.qr-col {
  flex: 0 0 190px;
}

.result-col {
  flex: 1;
  min-width: 0;
}

.copy-url-row {
  margin-top: 10px;
}

.copy-url-row .btn {
  width: 100%;
}

.qr-actions-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.qr-actions-row .btn {
  flex: 1;
  text-align: center;
}

/* ---------- QR ---------- */

.qr-block {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 12px;
}

.qr-block img {
  display: block;
  width: 180px;
  height: 180px;
  max-width: 100%;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
}

/* ---------- Мобільна версія ---------- */

@media (max-width: 768px) {
  .container {
    padding: 16px 12px 28px;
  }

  .title {
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 18px;
  }

  .card {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .form-row,
  .form-row-2,
  .form-row-2-1,
  .form-row-3,
  .result-row,
  .qr-actions-row,
  .result-layout {
    flex-direction: column;
  }

  .form-row,
  .form-row-3,
  .result-row,
  .qr-actions-row,
  .result-layout {
    gap: 12px;
  }

  .form-row-2 .field,
  .form-row-2-1 .field:first-child,
  .form-row-2-1 .field:last-child,
  .form-row-3 .field {
    flex: 1 1 100%;
    width: 100%;
  }

  .field {
    width: 100%;
  }

  label {
    text-align: left;
  }

  input,
  .result-row input {
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
  }

  #createBtn,
  .btn-small,
  .copy-url-row .btn,
  .qr-actions-row .btn,
  #downloadQrBtn {
    width: 100%;
  }

  .qr-col,
  .result-col {
    width: 100%;
    flex: none;
  }

  .qr-block {
    width: 100%;
  }

  .qr-block img {
    width: 180px;
    height: 180px;
  }
}