/* =====================================================================
   WebMinds Pay — shared theme (light)
   White canvas, slate type, one green accent.

   >>> To re-skin the whole system, edit the tokens in :root below. <<<
   ===================================================================== */

:root {
  color-scheme: light;

  /* Canvas */
  --bg:            #f5f7fa;
  --bg-raised:     #ffffff;
  --bg-sunken:     #f8fafc;
  --surface:       #ffffff;
  --surface-hover: #f3f6f9;

  /* Lines */
  --line:          #e6eaf0;
  --line-strong:   #d5dce5;

  /* Type */
  --text:          #0f172a;
  --text-soft:     #475569;
  --text-faint:    #8a94a6;

  /* Accent — change these to re-brand */
  --accent:        #00c063;
  --accent-hover:  #00a956;
  --accent-deep:   #008a47;
  --accent-ink:    #ffffff;
  --accent-wash:   rgba(0, 192, 99, 0.09);
  --accent-ring:   rgba(0, 192, 99, 0.22);

  /* States */
  --ok:            #00a956;
  --ok-wash:       #e7f9ef;
  --bad:           #e5484d;
  --bad-wash:      #fdecec;
  --warn:          #c27c0e;
  --warn-wash:     #fff5e0;
  --info:          #2f6fed;
  --info-wash:     #ebf2ff;

  /* Shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:    0 10px 30px -12px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 30px 60px -20px rgba(15, 23, 42, 0.22);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Plus Jakarta Sans", var(--font-body);

  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 { font-size: clamp(1.55rem, 1.25rem + 1.2vw, 2.05rem); }
h2 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1rem; max-width: 68ch; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--accent-ring); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* ----------------------------- Cards ----------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card--flat { background: var(--bg-sunken); box-shadow: none; }
.card__title { font-size: 1.02rem; margin-bottom: 4px; }
.card__sub { color: var(--text-soft); font-size: 0.88rem; margin: 0; }

/* ----------------------------- Buttons --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -6px rgba(0, 192, 99, 0.55), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn--primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }

.btn--ghost { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); border-color: #c5cdd8; }

.btn--soft { background: var(--accent-wash); color: var(--accent-deep); }
.btn--soft:hover:not(:disabled) { background: rgba(0,192,99,.16); color: var(--accent-deep); }

.btn--danger { background: #fff; color: var(--bad); border-color: #f5c2c4; }
.btn--danger:hover:not(:disabled) { background: var(--bad-wash); color: var(--bad); }

.btn--sm { padding: 7px 12px; font-size: 0.83rem; border-radius: var(--r-sm); }
.btn--block { width: 100%; }
.btn--lg { padding: 16px 26px; font-size: 1.02rem; border-radius: 14px; }

/* ----------------------------- Forms ----------------------------- */
.field { margin-bottom: 16px; }
.field--half { flex: 1 1 180px; }

.label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.label .req { color: var(--bad); }
.label .opt { color: var(--text-faint); font-weight: 500; }

.input, .select, .textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: #a3adbd; }
.input:hover, .select:hover, .textarea:hover { border-color: #c5cdd8; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
  outline: none;
}
.input[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, .12);
}

.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 11px;
  padding-right: 38px;
}

.row { display: flex; flex-wrap: wrap; gap: 14px; }
.row > .field { margin-bottom: 16px; }

.hint { font-size: 0.79rem; color: var(--text-faint); margin: 6px 0 0; }
.error-text { font-size: 0.79rem; color: var(--bad); margin: 5px 0 0; min-height: 0; }
.error-text:empty { display: none; }

/* ----------------------------- Alerts ---------------------------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-md);
  padding: 13px 16px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  margin-bottom: 20px;
}
.alert__icon { flex: 0 0 auto; margin-top: 2px; }
.alert__title { font-weight: 700; display: block; margin-bottom: 2px; }
.alert--error   { background: var(--bad-wash);  border-color: #f7c9cb; color: #9f1d22; }
.alert--success { background: var(--ok-wash);   border-color: #b8ebcf; color: #06603a; }
.alert--warn    { background: var(--warn-wash); border-color: #f5dca4; color: #7a4e05; }
.alert--info    { background: var(--info-wash); border-color: #c7d9fb; color: #1d4aa8; }
.alert[hidden] { display: none; }

/* ----------------------------- Badges ---------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: var(--bg-sunken);
  white-space: nowrap;
  text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge--ok    { background: var(--ok-wash);   border-color: #bfe9d2; color: #047a42; }
.badge--bad   { background: var(--bad-wash);  border-color: #f6c7c9; color: #c0262c; }
.badge--warn  { background: var(--warn-wash); border-color: #f2d9a4; color: #9a5f00; }
.badge--muted { background: #f1f4f8; color: #64748b; }

/* ----------------------------- Brand bar ------------------------- */
.brandbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brandbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
.brandbar__id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brandbar__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brandbar__note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-wash);
  border: 1px solid rgba(0, 192, 99, 0.22);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.brandbar__sep { width: 1px; height: 22px; background: var(--line-strong); }

/* ----------------------------- Utility --------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Spinner used on the Pay button and admin saves */
.spinner {
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

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