:root {
  font-family: Inter, Arial, sans-serif;
  color: #1a2e20;
  background: #f4f7f4;
  color-scheme: light;
  accent-color: #166534;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  --primary: #166534;
  --primary-dark: #14532d;
  --primary-soft: #e8f3ea;
  --text: #1a2e20;
  --border: #dce5dd;
  --muted: #5f6f63;
  --placeholder: #68776b;
}

* {
  box-sizing: border-box;
}

::selection {
  color: #14532d;
  background: #bbf7d0;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 18px;
  background: #f4f7f4;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin: 16px 0 28px;
}

.brand-mark {
  display: block;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.header h1 {
  margin: 0 auto;
  max-width: 540px;
  color: var(--text);
  font-size: clamp(23px, 5vw, 30px);
  line-height: 1.3;
  letter-spacing: -.8px;
}

.card {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(20, 48, 30, .045);
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 21px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 21px;
}

label {
  display: block;
  margin-bottom: 9px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #c6d3c9;
  border-radius: 8px;
  outline: none;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 101, 52, .14);
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

textarea {
  min-height: 115px;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.download-button,
.secondary-button {
  width: 100%;
  min-height: 48px;
  padding: 13px 16px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.message {
  display: none;
  padding: 13px 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.message.error {
  display: block;
  color: #991b1b;
  background: #fee2e2;
}

.queue-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 18px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.queue-info h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 16px;
}

.queue-info p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.queue-stat {
  min-width: 85px;
  padding: 12px;
  text-align: center;
  background: var(--primary-soft);
  border-radius: 9px;
}

.queue-stat strong {
  display: block;
  color: var(--primary);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.queue-stat span {
  color: var(--muted);
  font-size: 11px;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(10, 30, 18, .65);
}

.modal.show {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  padding: 27px;
  background: #fff;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modal-enter .2s ease-out;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-icon {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  color: #15803d;
  background: #dcfce7;
  border-radius: 50%;
}

.success-icon svg {
  width: 30px;
  height: 30px;
}

.modal-content h2 {
  margin: 9px 0;
  color: var(--text);
  font-size: 22px;
}

.modal-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ticket {
  margin: 22px 0;
  padding: 23px 15px;
  background: #f7faf7;
  border: 1px dashed #a9bdaa;
  border-radius: 12px;
}

.ticket-header {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #4b6151;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
}

.ticket-divider {
  height: 1px;
  margin: 17px 0;
  border-top: 1px dashed #cdd9cf;
}

.ticket-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.ticket-number {
  margin: 8px 0;
  color: var(--primary);
  font-size: 68px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
}

.ticket-date {
  color: var(--muted);
  font-size: 12px;
}

.ticket-footer {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.download-button {
  color: #fff;
  background: var(--primary);
}

.download-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  margin-top: 9px;
  color: #25432e;
  background: #e7eee8;
}

.secondary-button:hover {
  background: #dce7de;
}

@media (max-width: 600px) {
  body {
    padding: 18px 13px;
  }

  .header {
    margin-top: 10px;
  }

  .card {
    padding: 22px 18px;
  }

  .modal-content {
    padding: 23px 18px;
  }
}

@media (max-width: 380px) {
  .queue-info {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-stat {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
