/* ==========================================================================
   Ticket9jaPay — Design System
   Fintech-grade visual language: quiet, precise, generous whitespace.
   ========================================================================== */

:root {
  /* Palette (fixed per brief) */
  --color-primary: #0F172A;
  --color-accent: #16A34A;
  --color-accent-dark: #128a3e;
  --color-accent-soft: #E7F6EC;
  --color-bg: #F8FAFC;
  --color-card: #FFFFFF;
  --color-border: #E2E8F0;
  --color-text: #1E293B;
  --color-muted: #64748B;
  --color-error: #DC2626;
  --color-error-soft: #FDECEC;

  /* Type */
  --font-sans: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radius & shadow */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.12);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 260ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout shell ---------- */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  padding: 22px 0;
  border-bottom: 1px solid var(--color-border);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(155deg, var(--color-primary) 0%, #1E293B 100%);
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 4px;
  background: var(--color-accent);
}

.header-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.header-link:hover { color: var(--color-primary); background: #EEF2F6; }

main { flex: 1; }

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 48px;
  text-align: center;
  animation: fadeInUp var(--dur-med) var(--ease) both;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.hero h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  line-height: 1.05;
}

.hero p.subtitle {
  margin: 18px auto 0;
  max-width: 520px;
  font-size: 18px;
  color: var(--color-muted);
}

/* ---------- Section heading ---------- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 20px;
}
.section-heading h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}
.section-heading .hint {
  font-size: 13px;
  color: var(--color-muted);
}

section.block { padding: 20px 0 44px; }

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ---------- Payment / Org cards ---------- */
.pay-card, .org-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  animation: fadeInUp var(--dur-med) var(--ease) both;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-card:hover, .org-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.pay-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pay-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pay-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.pay-card .desc {
  font-size: 14px;
  color: var(--color-muted);
  min-height: 20px;
}

.pay-card .amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.pay-card .amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.org-card {
  cursor: pointer;
  text-align: left;
  width: 100%;
  align-items: flex-start;
}
.org-card h3 { font-size: 16px; font-weight: 700; color: var(--color-primary); }
.org-card .desc { font-size: 13px; color: var(--color-muted); }
.org-card:focus-visible { border-color: var(--color-accent); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(22, 163, 74, 0.15);
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--color-accent-dark); box-shadow: 0 6px 16px rgba(22, 163, 74, 0.25); }

.btn-secondary {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) { background: #F1F5F9; border-color: #CBD5E1; }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 15px; }

/* Spinner inside buttons */
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-dark {
  border: 2px solid rgba(15, 23, 42, 0.15);
  border-top-color: var(--color-primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Skeleton loading ---------- */
.skeleton-card {
  height: 168px;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, #EEF2F6 30%, #F6F8FA 50%, #EEF2F6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--color-border);
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(100deg, #EEF2F6 30%, #F6F8FA 50%, #EEF2F6 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  animation: fadeInUp var(--dur-fast) var(--ease) both;
}
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-body { color: inherit; }

.alert-error {
  background: var(--color-error-soft);
  border-color: #F6C6C6;
  color: var(--color-error);
}
.alert-info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1D4ED8;
}
.alert-success {
  background: var(--color-accent-soft);
  border-color: #A7E3B8;
  color: var(--color-accent-dark);
}

.alert-action {
  margin-top: 10px;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-muted);
}
.empty-state h3 { color: var(--color-primary); font-size: 16px; margin-bottom: 6px; }

/* ---------- Payments page layout ---------- */
.pay-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr;
  gap: 28px;
  align-items: flex-start;
  padding: 36px 0 64px;
}

.summary-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 96px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp var(--dur-med) var(--ease) both;
}
.summary-card .label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
}
.summary-card .org-name {
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
  color: #E2E8F0;
}
.summary-card .pay-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 18px;
}
.summary-card .pay-desc {
  font-size: 14px;
  color: #94A3B8;
  margin-top: 6px;
  line-height: 1.5;
}
.summary-card .divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 22px 0;
}
.summary-card .amount-block .amount {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.summary-card .secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 12.5px;
  color: #94A3B8;
}

.form-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp var(--dur-med) var(--ease) both;
}
.form-card h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}
.form-card .form-sub {
  font-size: 13.5px;
  color: var(--color-muted);
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 7px;
}
.field .optional-tag {
  font-weight: 400;
  color: var(--color-muted);
  font-size: 12px;
}
.field input,
.field select {
  width: 100%;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field input:hover, .field select:hover { border-color: #CBD5E1; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}
.field input[readonly], .field select[disabled] {
  background: #F1F5F9;
  color: var(--color-muted);
  cursor: not-allowed;
}
.field .error-text {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--color-error);
}
.field.has-error input,
.field.has-error select {
  border-color: var(--color-error);
}
.field.has-error .error-text { display: block; }

.form-alert-slot { margin-bottom: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 0;
  margin-top: auto;
}
.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer .foot-brand {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-primary);
}
.site-footer .foot-tag {
  font-size: 12.5px;
  color: var(--color-muted);
}
.site-footer .foot-powered {
  font-size: 12.5px;
  color: var(--color-muted);
}

/* ---------- Success page ---------- */
/* ==========================================================================
   SUCCESS PAGE
   ========================================================================== */

.success-page{
    min-height:calc(100vh - 140px);
    display:flex;
    justify-content:center;
    align-items:center;
    padding:4rem 1.5rem;
    background:#f8fafc;
}

.success-card{
    width:100%;
    max-width:560px;
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:18px;
    padding:3rem;
    text-align:center;
    box-shadow:0 20px 50px rgba(15,23,42,.08);
}

.success-icon{
    width:88px;
    height:88px;
    margin:0 auto 2rem;
    border-radius:50%;
    background:#dcfce7;
    display:flex;
    align-items:center;
    justify-content:center;
}

.success-icon svg{
    width:40px;
    height:40px;
}

.success-card h1{
    font-size:2rem;
    font-weight:700;
    color:#0f172a;
    margin-bottom:1rem;
}

.success-card p{
    color:#64748b;
    font-size:1rem;
    line-height:1.7;
}

.success-ref{
    margin-top:1.5rem;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:.75rem 1.2rem;
    border-radius:999px;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:.95rem;
    font-weight:600;
    border:1px solid #bfdbfe;
    word-break:break-all;
}

.success-actions{
    margin-top:2.5rem;
    display:flex;
    flex-direction:column;
    gap:1rem;
}

.btn--block{
    width:100%;
}

.btn{
    height:52px;
    border:none;
    border-radius:10px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:.25s ease;
}

.btn--dark{
    background:#0f172a;
    color:#ffffff;
}

.btn--dark:hover{
    background:#1e293b;
    transform:translateY(-2px);
}

.btn--outline{
    background:#ffffff;
    color:#0f172a;
    border:1px solid #d1d5db;
}

.btn--outline:hover{
    background:#f8fafc;
}

.btn:disabled{
    opacity:.6;
    cursor:not-allowed;
    transform:none;
}

.fade-in-up{
    animation:fadeInUp .6s ease;
}

@keyframes fadeInUp{

    from{
        opacity:0;
        transform:translateY(30px);
    }

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

}

/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width:640px){

.success-card{

padding:2rem 1.5rem;

}

.success-card h1{

font-size:1.6rem;

}

.success-icon{

width:72px;
height:72px;

}

.success-icon svg{

width:34px;
height:34px;

}

}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .pay-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 22px; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}