/* TAGRA PAY — shared public pages */

body {
  background: radial-gradient(1200px 700px at 15% -10%, #e9efff 0, #f4f6f9 45%, #f4f6f9 100%);
  min-height: 100vh;
}

.public-wrap,
.pay-wrap {
  width: 100%;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.page-back:hover {
  color: #334155;
}

/* Hero */
.public-hero,
.pay-hero {
  background: linear-gradient(120deg, #0b1738, #1f335c 55%, #273a63);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
}

.public-hero--error {
  background: linear-gradient(120deg, #450a0a, #7f1d1d 55%, #991b1b);
}

.public-hero-sub {
  opacity: 0.82;
  font-size: 1.02rem;
}

.hero-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.hero-brand {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.95;
  white-space: nowrap;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.hero-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.24);
}

.hero-title {
  margin: 0 0 4px;
  font-size: 2.05rem;
  line-height: 1.15;
  font-weight: 800;
}

.hero-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.brand-logo {
  width: 150px;
  height: 78px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.97);
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Cards */
.section,
.pay-card,
.status-card,
.page-card {
  border: 1px solid #e4e9f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.meta-card {
  border: 1px solid #e4e9f3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.meta-card--combined {
  padding: 0;
  overflow: hidden;
}

.meta-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-card-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  min-width: 0;
}

.meta-card-item:not(:last-child) {
  border-right: 1px solid #e8edf5;
}

.meta-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
}

.meta-icon--legal {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4338ca;
}

.meta-icon--address {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.meta-icon--phone {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.meta-label {
  color: #64748b;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 6px;
}

.meta-value {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.45;
  color: #0f172a;
  word-break: break-word;
}

.meta-value .is-muted {
  color: #94a3b8;
  font-weight: 600;
}

.meta-phone-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 800;
}

/* Wait / status */
.wait-card {
  border: 1px solid #e6ecf8;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #f2f7ff);
  padding: 16px 18px;
}

.wait-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff3cd;
  border: 1px solid #f6dd8a;
}

.wait-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.wait-sub {
  font-size: 0.92rem;
  color: #64748b;
  margin: 0;
}

.wait-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.wait-progress > span {
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  animation: public-wait-move 1.2s ease-in-out infinite;
}

@keyframes public-wait-move {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.status-result {
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid transparent;
}

.status-result--ok {
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
  color: #065f46;
}

.status-result--error {
  background: linear-gradient(180deg, #fff5f5, #fee2e2);
  border-color: #fecaca;
  color: #991b1b;
}

.status-result-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.status-result-msg {
  font-size: 0.92rem;
  margin: 0;
  opacity: 0.92;
}

/* Result grid */
.result-card {
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.result-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  border-top: 1px solid #eef2f7;
}

.result-row:first-child {
  border-top: 0;
}

.result-key {
  background: #f8fbff;
  color: #475569;
  font-weight: 700;
  padding: 14px 16px;
}

.result-val {
  padding: 14px 16px;
  color: #0f172a;
  font-weight: 600;
}

.result-row.result-total .result-key {
  background: linear-gradient(135deg, #eef4ff, #e2ebff);
}

.result-row.result-total .result-val {
  font-size: 1.28rem;
  font-weight: 800;
  color: #1d4ed8;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.result-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 12px;
  text-decoration: none;
}

.result-actions .btn .bi {
  line-height: 1;
  font-size: 1rem;
}

/* Tech details */
.tech-details {
  border: 1px solid #e4e9f3;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.tech-details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 700;
  color: #475569;
  list-style: none;
}

.tech-details summary::-webkit-details-marker {
  display: none;
}

.tech-details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}

.tech-details[open] summary::before {
  transform: rotate(90deg);
}

.tech-details-body {
  padding: 0 16px 14px;
}

/* Pay page */
.pay-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  font-weight: 700;
}

.pay-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.pay-amount-block {
  text-align: center;
  padding: 14px;
  border: 1px solid #e8edf7;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #f2f7ff);
}

.pay-amount-value {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 900;
  color: #1d4ed8;
}

.parking-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.parking-info-item {
  border: 1px solid #e8edf7;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfdff;
}

.parking-info-item.full {
  grid-column: 1 / -1;
}

.pay-input {
  height: 50px;
  border-radius: 12px;
}

.pay-note,
.pay-legal {
  font-size: 0.85rem;
  color: #64748b;
}

.pay-legal a {
  color: #475569;
}

.pay-message {
  display: none;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid #fecaca;
  background: linear-gradient(180deg, #fff5f5, #fff1f2);
  color: #991b1b;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font-weight: 600;
}

.pay-message.show {
  display: flex;
}

/* Buttons */
.btn-check-cost {
  background: linear-gradient(135deg, #315bdc, #3b82f6);
  border: none;
  border-radius: 12px;
  height: 50px;
  font-weight: 700;
}

.btn-check-cost:hover {
  background: linear-gradient(135deg, #274dc2, #2f70e4);
}

.btn-pay,
.btn-pay-submit {
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f6c338, #f59e0b);
  color: #111827;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.25);
}

.btn-pay:hover,
.btn-pay-submit:hover {
  background: linear-gradient(135deg, #efb729, #e89208);
  color: #111827;
}

.btn-pay-submit {
  height: 54px;
  font-size: 1.08rem;
}

.btn-retry,
.btn-outline-action {
  border-radius: 12px;
}

.btn-primary-action {
  background: linear-gradient(135deg, #315bdc, #3b82f6);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(49, 91, 220, 0.22);
}

.btn-primary-action:hover,
.btn-primary-action:focus {
  background: linear-gradient(135deg, #274dc2, #2f70e4);
  color: #fff;
}

.lang-switch .btn {
  border-radius: 10px;
}

/* Check page extras */
.id-label {
  font-size: 0.92rem;
  color: #334155;
  font-weight: 600;
  margin-bottom: 6px;
}

.hint {
  font-size: 0.84rem;
  color: #64748b;
}

.qr-scan-wrap {
  margin-bottom: 1rem;
}

.qr-scan-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #dbe3f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
  color: #1e293b;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
}

.qr-reader-wrap {
  width: min(100%, 340px);
  margin: 0 auto;
}

#qrReader {
  width: 100%;
  height: 255px;
  max-height: min(255px, 42vh);
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
}

.meta-card-content {
  min-width: 0;
  flex: 1;
}

#identifierInput {
  border-radius: 12px;
  height: 50px;
  font-size: 1.02rem;
}

#checkBtn {
  border-radius: 12px;
  height: 50px;
  font-weight: 700;
}

.pay-amount-block .pay-label {
  font-size: 0.82rem;
}

.pay-input:focus {
  border-color: #5b7de6;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.14);
}

.pay-message {
  margin-top: 0.75rem;
}

.pay-message i {
  margin-top: 0.1rem;
}

.pay-message.fade-out {
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pay-legal {
  margin-top: 0.5rem;
}

.qr-scan-toggle:hover {
  border-color: #c7d5ea;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.qr-scan-toggle[aria-expanded='true'] {
  border-color: #93b4f6;
  background: linear-gradient(180deg, #eff6ff 0%, #e8f0ff 100%);
}

.qr-scan-toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.qr-scan-toggle-chevron {
  transition: transform 0.2s ease;
  color: #64748b;
}

.qr-scan-toggle[aria-expanded='true'] .qr-scan-toggle-chevron {
  transform: rotate(180deg);
}

.qr-scan-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.qr-scan-panel.is-open {
  max-height: 420px;
}

.qr-scan-panel-inner {
  padding-top: 12px;
}

#qrReader video,
#qrReader canvas {
  border-radius: 14px;
  object-fit: cover !important;
}

@media (max-width: 767px) {
  #checkBtn {
    margin-top: 8px;
  }

  #qrReader {
    height: min(52vh, 320px);
    max-height: min(52vh, 320px);
  }

  .qr-reader-wrap {
    width: 100%;
    max-width: none;
  }

  .site-legal-panel {
    padding: 16px;
  }

  .site-legal-secure {
    justify-content: flex-start;
    text-align: left;
    max-width: none;
  }

  .site-legal-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-legal-copy {
    margin-left: 0;
  }
}

/* Legal footer */
.site-legal-footer {
  margin-top: 28px;
}

.site-legal-panel {
  border: 1px solid #e4e9f3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  padding: 18px 20px 14px;
  overflow: hidden;
}

.site-legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}

.site-legal-brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-legal-brand {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(120deg, #0b1738, #273a63);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-legal-name {
  color: #0f172a;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
}

.site-legal-name-full {
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.35;
  margin-top: 2px;
}

.site-legal-payments {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.site-legal-pay-logo {
  display: inline-flex;
  line-height: 0;
}

.site-legal-pay-logo img {
  display: block;
  height: 22px;
  width: auto;
}

.site-legal-pay-logo--pill img {
  height: 22px;
  border-radius: 4px;
}

.site-legal-pay-logo--tbank img {
  height: 20px;
  max-width: 96px;
}

.site-legal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 20px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2f7;
}

.site-legal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.site-legal-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e8edf5;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 600;
}

.site-legal-address {
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
}

.site-legal-secure {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: flex-end;
  text-align: right;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: 240px;
}

.site-legal-secure i {
  color: #2563eb;
  font-size: 1rem;
  margin-top: 1px;
}

.site-legal-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
}

.site-legal-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.site-legal-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e8edf5;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.site-legal-contact:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.site-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-legal-links a {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 10px;
  border: 1px solid #dbe3f0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

.site-legal-links a:hover {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f8fafc;
}

.site-legal-copy {
  margin-left: auto;
  color: #94a3b8;
  font-size: 0.76rem;
  white-space: nowrap;
}

.site-legal-footer a {
  text-decoration: none;
}

@media (max-width: 991px) {
  .meta-card-grid {
    grid-template-columns: 1fr;
  }

  .meta-card-item:not(:last-child) {
    border-right: 0;
    border-bottom: 1px solid #e8edf5;
  }
}

@media (max-width: 767px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .hero-divider {
    display: none;
  }

  .brand-logo {
    width: 128px;
    height: 68px;
  }

  .result-row {
    grid-template-columns: 1fr;
  }

  .result-key {
    border-bottom: 1px solid #edf1f6;
  }

  .pay-amount-value {
    font-size: 1.75rem;
  }

  .parking-info-grid {
    grid-template-columns: 1fr;
  }

  .site-legal-body {
    grid-template-columns: 1fr;
  }
}
