.tickets-page {
  display: grid;
  gap: 1.25rem;
}

.page-head {
  text-align: center;
  color: #fff;
  background: linear-gradient(140deg, #0f274d, #1e3c72 45%, #2e5eaa);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  margin-bottom: 0.2rem;
  position: relative;
  overflow: hidden;
}

.page-head::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  right: -60px;
  top: -60px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.32), transparent 70%);
}

.head-badge {
  display: inline-block;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  margin-bottom: 0.65rem;
}

.page-head h1 {
  font-size: clamp(1.5rem, 3.8vw, 2.2rem);
  margin-bottom: 0.45rem;
}

.page-head p {
  opacity: 0.96;
}

.premium-form {
  padding: 1.35rem;
  border: 1px solid #e7ecf7;
  box-shadow: 0 16px 35px rgba(17, 24, 39, 0.08);
}

.section-block + .section-block {
  margin-top: 1.2rem;
}

.section-block h2 {
  color: #133567;
  margin-bottom: 0.8rem;
  font-size: 1.18rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.service-select-wrap {
  max-width: 520px;
  margin: 0 auto;
}

#servicio {
  font-weight: 600;
  color: #1b3f72;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

label {
  font-weight: 650;
  color: #1b3f72;
  font-size: 0.95rem;
}

input, textarea, select {
  border: 1px solid #d7e0ef;
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  background: #fff;
  transition: all 0.2s ease;
}

input::placeholder, textarea::placeholder {
  color: #9aa8c0;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #8aa6d6;
  box-shadow: 0 0 0 4px rgba(46, 94, 170, 0.12);
}

.shoe-container {
  display: flex;
  gap: 1rem;
  align-items: stretch;
  flex-wrap: wrap;
}

.shoe-canvas-container {
  background: #fbfdff;
  border: 1px solid #e2eaf7;
  border-radius: 14px;
  padding: 0.8rem;
  flex: 1 1 420px;
  min-width: 290px;
}

#shoeCanvas {
  width: 100%;
  border: 2px dashed #bed0ec;
  border-radius: 12px;
  background: #ffffff url("../assets/image1shoe.png") center/contain no-repeat;
  max-width: 100%;
}

.color-tools {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.color-btn {
  border: 1px solid #d3def0;
  background: #fff;
  color: #1c3f74;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-btn:hover {
  transform: translateY(-1px);
  border-color: #9fb8de;
}

.color-btn.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(19, 53, 103, 0.2);
}

.color-btn[data-color="#ff6b6b"].active { background: #ff6b6b; }
.color-btn[data-color="#feca57"].active { background: #f5b932; }
.color-btn[data-color="#48dbfb"].active { background: #2abfe0; }

.canvas-tools {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
}

.tool-btn {
  border: none;
  border-radius: 999px;
  padding: 0.56rem 0.95rem;
  cursor: pointer;
  background: #1f4a87;
  color: #fff;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tool-btn:hover {
  transform: translateY(-1px);
  background: #2a5da7;
}

.premium-legend {
  background: linear-gradient(170deg, #f8fbff, #eef4ff);
  border: 1px solid #dbe6f7;
  border-radius: 14px;
  padding: 0.9rem;
  min-width: 220px;
  flex: 0 0 230px;
}

.premium-legend h3 {
  color: #1a3f76;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
}

.legend-color {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #223;
}

.legend-tip {
  margin-top: 0.65rem;
  color: #53627a;
  font-size: 0.86rem;
}

.dirty { background: #ff6b6b; }
.damage { background: #feca57; }
.special { background: #48dbfb; }

.generate-btn {
  width: 100%;
  margin-top: 1rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  background: linear-gradient(135deg, #133567, #2c5ea6);
  box-shadow: 0 10px 25px rgba(19, 53, 103, 0.28);
  transition: all 0.25s ease;
}

.generate-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.history-section {
  margin-top: 0.15rem;
  padding: 1rem;
}

.premium-history h2 {
  color: #133567;
  margin-bottom: 0.7rem;
}

#historyList {
  display: grid;
  gap: 0.65rem;
  max-height: 350px;
  overflow: auto;
  padding-right: 0.3rem;
}

.history-item {
  border: 1px solid #e1e8f6;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fbfdff;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 30, 0.64);
  z-index: 1400;
  padding: 1rem;
}

.modal-content {
  max-width: 650px;
  margin: 8vh auto 0;
  background: white;
  border-radius: 18px;
  padding: 1.2rem;
}

.premium-modal {
  border: 1px solid #e5ebf7;
  box-shadow: 0 18px 35px rgba(15, 39, 77, 0.18);
}

.modal-subtitle {
  margin-top: -0.2rem;
  margin-bottom: 0.65rem;
  color: #52647f;
}

.ticket-preview {
  border: 1px solid #e8eef9;
  border-radius: 12px;
  background: #f9fbff;
  padding: 0.85rem;
}

.modal-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.btn-secondary {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 780px) {
  .page-head {
    padding: 1.4rem 1rem;
  }

  .premium-form {
    padding: 1rem;
  }

  .premium-legend {
    flex: 1 1 100%;
    min-width: unset;
  }
}
