:root {
  --ink: #101917;
  --muted: #60716d;
  --line: rgba(16, 25, 23, .14);
  --blue: #0d6df2;
  --green: #10d9bb;
  --paper: #f5f7f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, "Helvetica Neue", sans-serif;
}

.ticket-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 32px;
  padding: 32px;
}

.ticket-form-panel,
.ticket-result {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ticket-form-panel {
  align-self: start;
  padding: 28px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.08;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(13, 109, 242, .15);
}

button,
.ticket-actions a {
  min-height: 52px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

form button {
  width: 100%;
}

.errors {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 4px solid #d33;
  background: #fff0f0;
}

.errors p {
  margin: 0;
  color: #9b1c1c;
}

.ticket-result {
  min-width: 0;
  padding: 20px;
}

.ticket-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.ticket-actions button,
.ticket-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
}

.ticket-actions a {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
}

.ticket-svg {
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(16, 25, 23, .08);
}

@media (max-width: 980px) {
  .ticket-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ticket-page {
    padding: 14px;
  }

  .ticket-form-panel,
  .ticket-result {
    padding: 18px;
  }

  h1 {
    font-size: 28px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    background: #fff;
  }

  .ticket-page {
    display: block;
    padding: 0;
    min-height: 0;
  }

  .ticket-form-panel,
  .ticket-actions {
    display: none;
  }

  .ticket-result {
    border: 0;
    padding: 0;
    width: 210mm;
    height: 297mm;
    overflow: hidden;
  }

  .ticket-svg {
    display: block;
    width: 155mm;
    height: auto;
    max-height: 287mm;
    margin: 5mm auto;
    box-shadow: none;
    border-radius: 0;
  }
}
