@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg-app: #F7F5FB;
  --bg-raised: #FFFFFF;
  --surface-lavender: #B8A6FF;
  --surface-sky: #9EC9F0;
  --surface-mint: #7DD4A8;
  --surface-peach: #FFB59E;
  --surface-pink: #F5B8D0;
  --surface-lemon: #F5D77A;
  --action-primary: #FF7A6B;
  --action-on: #FFFFFF;
  --status-archived: #C9B5FF;
  --text-strong: #2E2A3F;
  --text-muted: #6B6580;
  --border-color: #C9B5FF;
  --code-bg: #201933;
  --code-text: #C9C0E8;
  --r-card: 28px;
  --r-button: 18px;
  --r-chip: 999px;
  --r-input: 16px;
  --r-icon: 20px;
  --nav-height: 58px;

  --shadow-white: 8px 8px 22px rgba(140,108,255,0.16), -8px -8px 20px rgba(255,255,255,0.85), inset 3px 3px 6px rgba(255,255,255,0.7), inset -5px -5px 10px rgba(140,108,255,0.10);
  --shadow-lavender: 8px 8px 22px rgba(140,108,255,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(140,108,255,0.28);
  --shadow-sky: 8px 8px 22px rgba(80,150,220,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(80,150,220,0.28);
  --shadow-mint: 8px 8px 22px rgba(70,180,130,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(70,180,130,0.28);
  --shadow-peach: 8px 8px 22px rgba(255,140,110,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(255,140,110,0.28);
  --shadow-pink: 8px 8px 22px rgba(230,140,180,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(230,140,180,0.28);
  --shadow-lemon: 8px 8px 22px rgba(220,180,70,0.32), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.55), inset -5px -5px 10px rgba(220,180,70,0.28);
  --shadow-coral: 8px 8px 22px rgba(230,90,75,0.35), -6px -6px 18px rgba(255,255,255,0.6), inset 3px 3px 6px rgba(255,255,255,0.5), inset -5px -5px 10px rgba(230,90,75,0.30);
  --shadow-pressed: inset 4px 4px 8px rgba(140,108,255,0.20), inset -4px -4px 8px rgba(255,255,255,0.75);
  --shadow-sm: 4px 4px 12px rgba(140,108,255,0.18), -3px -3px 10px rgba(255,255,255,0.7);

  /* Referenced by inline style on #btnCekProfil */
  --primary-grad: linear-gradient(135deg, var(--surface-peach), var(--action-primary));
  /* State colors */
  --status-invalid: #D64550;
  --status-valid: #128A56;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

button, a { touch-action: manipulation; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.bg-fixed-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-color: var(--bg-app);
}

body {
  background-color: transparent;
  font-family: 'Quicksand', 'Nunito', sans-serif;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

/* ---------- Card ---------- */
.container {
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: var(--bg-raised);
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-white);
  padding: 1.6rem;
  text-align: center;
}

.banner-img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
  border: none;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-lavender);
  background-color: var(--bg-app);
  margin-bottom: 1.4rem;
}

.container h2 {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--text-strong);
  overflow-wrap: break-word;
}

#loadingState {
  padding: 1.8rem 0;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  color: var(--text-muted);
}

/* ---------- Account info well ---------- */
.user-info {
  background: var(--bg-app);
  border: none;
  border-radius: var(--r-input);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
  text-align: left;
  box-shadow: var(--shadow-pressed);
}
.user-info label {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}
.user-info span {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-strong);
  word-break: break-all;
}

/* ---------- Form fields ---------- */
.form-group { text-align: left; margin-bottom: 1.1rem; }

label {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-strong);
}

input {
  width: 100%;
  padding: 13px 15px;
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--r-input);
  background: var(--bg-app);
  color: var(--text-strong);
  box-shadow: var(--shadow-pressed);
  outline: none;
  transition: box-shadow 0.15s ease;
}
input::placeholder { color: var(--text-muted); opacity: 0.7; }
input:focus { box-shadow: var(--shadow-pressed), 0 0 0 3px rgba(184,166,255,0.4); }

.hint {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.error-text {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--status-invalid);
  margin-top: 6px;
  display: none;
}

/* ---------- Voucher ---------- */
.voucher-row { display: flex; gap: 10px; }
.voucher-row input { flex: 1; }

.btn-voucher {
  flex-shrink: 0;
  padding: 0 20px;
  border: none;
  border-radius: var(--r-input);
  background: var(--surface-sky);
  color: var(--text-strong);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sky);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-voucher:hover:not(:disabled) { transform: translateY(-2px); }
.btn-voucher:active:not(:disabled) { transform: scale(0.96); box-shadow: var(--shadow-pressed); }
.btn-voucher:disabled { background: #D9D3EE; color: #8A82A8; box-shadow: var(--shadow-pressed); cursor: not-allowed; }

.voucher-status {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 8px;
  min-height: 14px;
}
.voucher-status.valid { color: var(--status-valid); }
.voucher-status.invalid { color: var(--status-invalid); }

/* ---------- Total preview ---------- */
.total-preview-box {
  background: var(--surface-peach);
  border: none;
  border-radius: var(--r-card);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  text-align: left;
  box-shadow: var(--shadow-peach);
}
.total-preview-box label {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-strong);
  opacity: 0.75;
  display: block;
  margin-bottom: 4px;
}
.total-preview-box .value {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.4;
}

/* ---------- Turnstile ---------- */
.turnstile-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 1rem 0 0.25rem;
  min-height: 65px;
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 24px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  border-radius: var(--r-button);
  background: var(--action-primary);
  color: var(--action-on);
  box-shadow: var(--shadow-coral);
  margin-top: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: scale(0.97); box-shadow: var(--shadow-pressed); }
.btn:disabled { background: #D9D3EE; color: #8A82A8; box-shadow: var(--shadow-pressed); cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-app);
  color: var(--text-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:active:not(:disabled) { box-shadow: var(--shadow-pressed); }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(46,42,63,0.25);
  border-top-color: var(--text-strong);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- QRIS block ---------- */
#qrContainer {
  display: none;
  margin-top: 1.2rem;
  padding: 1.4rem;
  border: none;
  border-radius: var(--r-card);
  background: var(--bg-app);
  box-shadow: var(--shadow-pressed);
  text-align: center;
}

#qrHeaderTitle {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-strong);
  margin-bottom: 0.3rem;
  overflow-wrap: break-word;
}

#timerDisplay {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--status-invalid);
  margin: 0.4rem 0 0.8rem;
  transition: color 0.3s ease;
}
#timerDisplay.warning { animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.price-summary {
  background: var(--bg-raised);
  border: none;
  border-radius: var(--r-input);
  padding: 0.9rem 1.1rem;
  margin: 0.9rem 0;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.price-line {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.price-line s { color: #9fb3c2; font-weight: normal; }
.price-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 2px dashed rgba(140,108,255,0.25);
}
.price-total {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}

.copy-btn {
  flex-shrink: 0;
  background: var(--surface-mint);
  border: none;
  border-radius: var(--r-chip);
  padding: 6px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-strong);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.copy-btn:hover { transform: translateY(-1px); }
.copy-btn:active { transform: scale(0.95); box-shadow: var(--shadow-pressed); }

#qrImage {
  display: block;
  max-width: 220px;
  width: 100%;
  margin: 0.8rem auto;
  padding: 10px;
  background: #fff;
  border: none;
  border-radius: var(--r-input);
  box-shadow: var(--shadow-white);
}

.info {
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.8rem;
  line-height: 1.5;
}

/* ---------- Responsive ---------- */
@media (max-width: 380px) {
  .container { padding: 1.2rem; border-radius: 22px; }
  .container h2 { font-size: 1.3rem; }
  #qrContainer { padding: 1rem; border-radius: 22px; }
  .btn-voucher { padding: 0 14px; }
}

@media (min-width: 769px) {
  body { padding: 3rem 1.5rem; font-size: 15.5px; }
  .container { padding: 2.2rem; border-radius: 32px; }
  .container h2 { font-size: 1.7rem; }
  .banner-img { max-height: 220px; margin-bottom: 1.6rem; }
  #qrContainer { padding: 1.6rem; border-radius: 26px; }
  #qrHeaderTitle { font-size: 1.35rem; }
}

/* ---------- Custom Notification ---------- */

.notification-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(46, 42, 63, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: notificationFadeIn 0.18s ease;
}

.notification-overlay.show {
  display: flex;
}

.notification-box {
  width: 100%;
  max-width: 390px;
  padding: 1.7rem 1.5rem 1.5rem;
  background: var(--bg-raised);
  border-radius: var(--r-card);
  text-align: center;
  box-shadow: var(--shadow-white);
  animation: notificationScaleIn 0.2s ease;
}

.notification-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-peach);
  color: var(--text-strong);
  font-family: 'Quicksand', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: var(--shadow-peach);
}

.notification-box h3 {
  margin: 0 0 0.6rem;
  color: var(--text-strong);
  font-family: 'Quicksand', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.notification-box p {
  margin: 0;
  color: var(--text-muted);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.notification-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 1.2rem;
  padding: 12px 20px;
  border: none;
  border-radius: var(--r-button);
  background: var(--action-primary);
  color: var(--action-on);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-coral);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.notification-btn:hover {
  transform: translateY(-2px);
}

.notification-btn:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-pressed);
}

.notification-overlay.success .notification-icon {
  background: var(--surface-mint);
  box-shadow: var(--shadow-mint);
}

.notification-overlay.warning .notification-icon {
  background: var(--surface-lemon);
  box-shadow: var(--shadow-lemon);
}

.notification-overlay.error .notification-icon {
  background: var(--surface-peach);
  box-shadow: var(--shadow-peach);
}

@keyframes notificationFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes notificationScaleIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }

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

@media (max-width: 380px) {
  .notification-box {
    padding: 1.4rem 1.2rem 1.2rem;
    border-radius: 22px;
  }

  .notification-icon {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
  }

  .notification-box h3 {
    font-size: 1.1rem;
  }

  .notification-box p {
    font-size: 0.85rem;
  }
}
