/* Casa Tapputi — ticket flow visual layer
   Shared by workshop/event pages that load TicketsClient.
   Logic stays in the page scripts; this file only improves presentation. */

/* Purchase form: keep the action visually anchored and easy to scan. */
.form-section.active {
  animation: ticket-panel-in .45s cubic-bezier(.22, 1, .36, 1) both;
}

.form-section > h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem) !important;
  letter-spacing: .02em;
}

.form-section > h3::before,
.form-section > h3::after {
  content: "";
  width: clamp(28px, 8vw, 72px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.65));
}

.form-section > h3::after {
  background: linear-gradient(90deg, rgba(212,175,55,.65), transparent);
}

.person-fields {
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.person-fields::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--miel), transparent);
}

.person-fields:focus-within {
  border-color: rgba(212,175,55,.42);
  box-shadow: 0 16px 36px rgba(0,0,0,.18), 0 0 0 3px rgba(212,175,55,.08);
}

.field input {
  min-height: 46px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field input::placeholder,
.wa-all-section input::placeholder {
  color: rgba(239,230,214,.42);
}

.field input[aria-invalid="true"] {
  border-color: #e06c6c !important;
  box-shadow: 0 0 0 3px rgba(224,108,108,.1);
}

/* Shared status messages: clear hierarchy instead of a lost line of text. */
.msg {
  position: relative;
  display: none;
  max-width: 560px;
  margin: 18px auto;
  padding: 16px 18px;
  border-radius: 12px;
  line-height: 1.55;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  animation: ticket-panel-in .35s ease both;
}

.msg.active { display: block; }

.msg-loading {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  color: var(--tinta) !important;
  background: linear-gradient(135deg, rgba(212,175,55,.16), rgba(255,255,255,.04)) !important;
  border: 1px solid rgba(212,175,55,.36) !important;
}

.msg-loading::before {
  content: "";
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(212,175,55,.28);
  border-top-color: var(--miel);
  border-radius: 50%;
  animation: ticket-spin .8s linear infinite;
}

.msg-error {
  color: #ffd1d1 !important;
  background: linear-gradient(135deg, rgba(150,38,38,.24), rgba(229,57,53,.08)) !important;
  border: 1px solid rgba(229,108,108,.42) !important;
}

.msg-success {
  color: #c8edca !important;
  background: linear-gradient(135deg, rgba(56,118,64,.2), rgba(165,214,167,.06)) !important;
  border: 1px solid rgba(165,214,167,.34) !important;
}

.msg-info {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left !important;
  color: var(--tinta) !important;
  background: linear-gradient(135deg, rgba(212,175,55,.2), rgba(255,255,255,.05)) !important;
  border: 1px solid rgba(212,175,55,.42) !important;
}

.msg-info::before {
  content: "🎫";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(212,175,55,.18);
  font-size: 1.15rem;
}

.msg-info strong { color: var(--miel) !important; }

.msg-info button {
  flex: 0 0 auto;
  margin-left: auto !important;
  min-height: 42px;
  padding: 9px 14px !important;
  font-family: inherit;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(0,0,0,.16);
  transition: transform .2s ease, filter .2s ease;
}

.msg-info button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* Primary action: stronger affordance without changing its existing color. */
.btn-primary {
  min-height: 52px;
  letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(212,175,55,.16);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(212,175,55,.26);
  filter: brightness(1.05);
}

.btn-primary:disabled { opacity: .72; }

/* QR result stage: make the result feel like a confirmation, not a dump of data. */
.qr-results.active {
  animation: ticket-panel-in .5s cubic-bezier(.22, 1, .36, 1) both;
}

.qr-results > h3 {
  font-size: clamp(1.55rem, 4vw, 2.1rem);
  color: var(--miel) !important;
}

.qr-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(212,175,55,.25) !important;
  background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.025)) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.qr-card::before {
  content: "BOLETO DIGITAL";
  position: absolute;
  top: 12px;
  right: 16px;
  color: rgba(212,175,55,.72);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.qr-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212,175,55,.52) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,.24);
}

.qr-card .qr-img {
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.24);
}

.qr-card .qr-info {
  min-width: min(260px, 100%);
}

.qr-card .qr-info .name {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: .02em;
}

.qr-card .qr-info .token {
  max-width: 260px;
  opacity: .66;
}

.btn-wa,
.btn-wa-all {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 8px 18px rgba(37,211,102,.18);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.btn-wa:hover,
.btn-wa-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(37,211,102,.3);
}

.wa-all-section {
  padding: 20px;
  border: 1px solid rgba(37,211,102,.2);
  border-radius: 12px;
  background: rgba(37,211,102,.055);
}

.wa-all-section input {
  min-height: 44px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.wa-all-section input[aria-invalid="true"] {
  border-color: #e06c6c !important;
  box-shadow: 0 0 0 3px rgba(224,108,108,.1);
}

/* Make discount controls feel like a secondary, trustworthy step. */
.discount-section.active {
  padding: 16px;
  border: 1px solid rgba(239,230,214,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  animation: ticket-panel-in .35s ease both;
}

/* Compact layout for phones: no horizontal squeeze or tiny QR actions. */
@media (max-width: 600px) {
  .tiers { gap: 12px; }
  .tier { padding: 22px 14px; }
  .tier .price { font-size: 1.72rem; }
  .form-section > h3::before,
  .form-section > h3::after { width: 20px; }
  .person-fields { padding: 17px 15px; }
  .msg-info { align-items: flex-start; flex-wrap: wrap; }
  .msg-info::before { margin-top: 1px; }
  .msg-info button { width: 100%; margin: 2px 0 0 !important; }
  .qr-card { padding: 30px 14px 18px; }
  .qr-card .qr-info { width: 100%; text-align: center; }
  .qr-card .qr-info .token { margin-inline: auto; }
  .qr-card .btn-wa { width: 100%; }
  .wa-all-section input { width: 100%; max-width: none; margin: 0 0 8px; }
  .btn-wa-all { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .form-section.active,
  .msg,
  .qr-results.active,
  .discount-section.active { animation: none; }
  .msg-loading::before { animation: none; }
  .person-fields,
  .qr-card,
  .btn-primary,
  .btn-wa,
  .btn-wa-all { transition: none; }
}

@keyframes ticket-spin { to { transform: rotate(360deg); } }
@keyframes ticket-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
