/* ══════════════════════════════════════════════════
   VERITY XENDIT — CHECKOUT FORM (plugin shortcode)
   Mirrors integration_payment_portal verisafe-report styling.
   Century Gothic is bundled with the plugin for checkout consistency.
   ══════════════════════════════════════════════════ */

@font-face {
  font-family: 'Century Gothic';
  src: url('../fonts/CenturyGothic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Century Gothic';
  src: url('../fonts/CenturyGothic-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── TOKENS ───────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

:root {
  --bg: #FAFBFF;
  --surface: #FFFFFF;
  --navy: rgba(26, 31, 23, 1);
  --green: rgba(68, 214, 44, 1);
  --green-dark: #38b824;
  --dark-text: rgba(26, 31, 23, 1);
  --muted: rgba(90, 101, 84, 1);
  --border: #E2E8F4;
  --vi-text: #212529;
  --vi-gray: #7a8e9a;
  --vi-light-bg: #f7faf6;
  --vi-border: #e4e8e0;
  --error: #dc3545;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* ══════════════════════════════════════════════════
   CHECKOUT / FORM
   ══════════════════════════════════════════════════ */

.checkout-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
}

.checkout-header {
  text-align: left;
  margin-bottom: 32px;
}

.checkout-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.checkout-tag-bar {
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}

.checkout-title {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 14px;
}

.checkout-sub {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 540px;
}

/* ── FORM CARD ────────────────────────────── */
.checkout-form {
  background: var(--surface);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--card-shadow);
  border: 1px solid #ECECE6;
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
}

input, select, button, textarea, optgroup, option {
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
}

/* ── SECTION TITLE ────────────────────────── */
.lp-form-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--vi-text);
  margin-top: 2rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1.5px solid var(--vi-border);
}

.lp-form-section-title:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.lp-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: var(--vi-text);
  font-size: 0.8rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── GRID + FIELDS ────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.form-field { display: flex; flex-direction: column; gap: 0.45rem; }
.form-field-full { grid-column: 1 / -1; }

.form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--vi-gray);
  margin-bottom: 0;
}

.form-asterisk {
  color: red;
  margin-left: 2px;
}

.form-field input,
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--vi-light-bg);
  border: 1.5px solid var(--vi-border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--vi-text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input::placeholder { color: #bfc9ba; }

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(68, 214, 44, 0.15);
  background: var(--vi-light-bg);
}

.form-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%237a8e9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-field select option {
  font-size: 16px !important;
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif !important;
  color: var(--vi-text);
  background: #fff;
  padding: 10px 12px;
  line-height: 1.4;
}

.form-field input.error,
.form-field select.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

.field-error {
  display: block;
  min-height: 1em;
  margin-top: 0.25rem;
  color: var(--error);
  font-size: 0.85rem;
  line-height: 1.3;
}
.field-error:empty { min-height: 0; margin-top: 0; }

/* ══════════════════════════════════════════════════
   E-INVOICING — RADIO CARDS + BRANCHING
   ══════════════════════════════════════════════════ */

.einv-block { margin-bottom: 1.25rem; }
.einv-branch { margin-top: 1.25rem; }
.einv-branch[hidden] { display: none; }

.radio-card-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12rem;
}

@media (max-width: 610px) {
  .radio-card-group { gap: 1.5rem; }
}

@media (max-width: 400px) {
  .radio-card-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}

.form-radio {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.form-check-input {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #212529;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  margin: 0 15px 0 0;
  background-color: transparent;
  box-shadow: none;
  flex-shrink: 0;
}

.form-check-input:checked {
  background-color: transparent;
  border-color: #212529;
}

.form-check-input:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #212529;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.form-check-input:focus,
.form-check-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.form-check-label {
  color: #7a8e9a;
  font-weight: bold;
  font-size: 14px;
  margin: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}

.sub-question {
  color: #7a8e9a;
  font-weight: bold;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.einv-nric { margin-top: 1.25rem; }
.einv-nric[hidden] { display: none; }

.note {
  color: #7a8e9a;
  margin-top: 1rem;
  margin-left: 1rem;
  font-size: 0.85rem;
}

.checkout-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════════
   SUBMIT BUTTON
   ══════════════════════════════════════════════════ */

.btn-submit {
  width: 100%;
  background: var(--green);
  color: var(--vi-text);
  font-family: 'Century Gothic', CenturyGothic, AppleGothic, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  border: none;
  padding: 1.1rem;
  border-radius: 100px;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.btn-submit:hover:not(:disabled) {
  background: var(--green-dark);
  box-shadow: 0 8px 30px rgba(68, 214, 44, 0.4);
  transform: translateY(-2px);
  color: #000;
}

.btn-submit:disabled {
  background: #b0b0b0;
  color: #fff;
  cursor: not-allowed;
}

.btn-arrow { font-size: 1.1rem; line-height: 1; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .checkout-main { padding-top: 48px; }
}

@media (max-width: 640px) {
  .checkout-main { padding: 32px 16px 60px; }
  .checkout-form { padding: 1.75rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0.85rem; }
  .form-field-full { grid-column: 1; }
}
