:root {
  --blue: #0b2c5c;
  --blue-deep: #081e40;
  --gold: #f2c14e;
  --red: #c8102e;
  --green: #1c8b5c;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #667085;
  --border: #d9e0ea;
  --focus: #2f6bd8;
  --radius: 12px;
  --shadow: 0 12px 32px rgba(11, 44, 92, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  line-height: 1.55;
}

.topbar {
  background: var(--blue-deep);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.flag {
  font-size: 36px;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.3px;
}

.brand p {
  margin: 0;
  font-size: 13px;
  opacity: 0.82;
}

.admin-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--gold);
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.admin-link:hover {
  background: var(--gold);
  color: var(--blue-deep);
}

.container {
  max-width: 860px;
  margin: 26px auto;
  padding: 0 16px 60px;
}

.notice {
  background: #fff7e6;
  border-left: 4px solid var(--gold);
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #6b4d16;
}

form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 0 22px;
  padding: 18px 20px 22px;
}

legend {
  font-weight: 700;
  font-size: 17px;
  color: var(--blue);
  padding: 0 8px;
}

.grid {
  display: grid;
  gap: 14px 16px;
}

.grid.two {
  grid-template-columns: repeat(2, 1fr);
}

.grid.three {
  grid-template-columns: repeat(3, 1fr);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}

label.full {
  grid-column: 1 / -1;
}

input,
select {
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 107, 216, 0.15);
}

input.invalid,
select.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.phone-row {
  display: flex;
  gap: 8px;
}

.phone-code {
  width: 90px;
  flex: 0 0 90px;
}

.subtitle {
  margin: 22px 0 14px;
  font-size: 15px;
  color: var(--blue);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}

.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  font-weight: 500;
  padding: 8px 0;
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--green);
}

.actions {
  text-align: center;
  margin-top: 8px;
}

.btn {
  display: inline-block;
  padding: 13px 32px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.2s;
}

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

.btn.primary {
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: #11427e;
}

.btn.gold {
  background: var(--gold);
  color: var(--blue-deep);
}

.btn.green {
  background: var(--green);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--blue);
}

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

.fee-note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 0;
}

/* 付款页 */
.pay-card {
  max-width: 520px;
  margin: 0 auto;
}

.pay-header {
  text-align: center;
  margin-bottom: 20px;
}

.pay-header .amount {
  font-size: 30px;
  color: var(--blue);
  font-weight: 800;
}

.stripe-badge {
  text-align: right;
  font-size: 13px;
  color: #635bff;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-input {
  position: relative;
}

.card-input input {
  width: 100%;
  padding-left: 42px;
  font-size: 18px;
}

.card-icons {
  text-align: right;
  font-size: 20px;
  margin-top: 4px;
}

.card-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 12px;
}

.secure-note {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
  justify-content: center;
}

/* 成功页 */
.success-wrap {
  text-align: center;
  padding: 30px 20px;
}

.success-icon {
  font-size: 72px;
  margin-bottom: 10px;
}

.success-title {
  font-size: 26px;
  color: var(--green);
  margin: 0 0 8px;
}

.success-ref {
  display: inline-block;
  background: #eefaf3;
  color: var(--green);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  margin: 10px 0 20px;
}

.receipt {
  text-align: left;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  background: #fafbfd;
}

.receipt h3 {
  margin: 0 0 10px;
  color: var(--blue);
}

.receipt table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.receipt td {
  padding: 6px 0;
  border-bottom: 1px solid #eef1f6;
}

.receipt td:first-child {
  color: var(--muted);
  width: 42%;
}

/* 后台 */
.admin-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

table.admin {
  width: 100%;
  border-collapse: collapse;
  min-width: 1000px;
  font-size: 13px;
}

table.admin th,
table.admin td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

table.admin th {
  background: var(--blue);
  color: #fff;
  white-space: nowrap;
}

table.admin tr:nth-child(even) td {
  background: #f7f9fc;
}

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.status.paid {
  background: #eefaf3;
  color: var(--green);
}

.status.pending {
  background: #fff7e6;
  color: #a16a00;
}

.admin-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}

.record-id {
  font-family: monospace;
  font-weight: 700;
  color: var(--blue);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 50px 10px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}

.summary-card .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
}

.summary-card .lbl {
  font-size: 13px;
  color: var(--muted);
}

/* 语言选择页 */
.landing {
  max-width: 680px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.landing-title {
  text-align: center;
  font-size: 24px;
  color: var(--blue);
  margin: 0 0 8px;
}

.landing-hint {
  text-align: center;
  color: var(--muted);
  margin: 0 0 22px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s;
}

.lang-btn:hover {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 107, 216, 0.12);
}

.lang-btn.active {
  border-color: var(--blue);
  background: #eef3fb;
  color: var(--blue);
}

.lang-flag {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  width: 24px;
  justify-content: center;
}

.lang-flag img {
  display: block;
}

.language-notice {
  margin-top: 20px;
  background: #fff1f0;
  border: 1px solid #ffccc7;
  border-left: 5px solid var(--red);
  color: #7a1420;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

/* 顶部操作组 */
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* 英文必填警示 */
.notice-english {
  background: #fff1f0;
  border-left: 6px solid var(--red);
  color: #7a1420;
}

.notice-english strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.notice-english span {
  display: block;
  margin-top: 4px;
}

/* 同意弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 30, 64, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

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

.modal {
  background: #fff;
  border-radius: 14px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.modal-header {
  background: var(--blue-deep);
  color: #fff;
  padding: 18px 22px;
  border-radius: 14px 14px 0 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-body {
  padding: 22px;
}

.consent-main {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.consent-main p {
  margin: 0 0 12px;
}

/* 次要：代填写收费服务（低调） */
.consent-minor {
  margin-top: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  background: #f6f7f9;
  border-radius: 8px;
  padding: 12px 14px;
}

.modal-actions {
  padding: 0 22px 22px;
  display: flex;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 180px;
}

/* RTL 兼容（阿拉伯语） */
[dir="rtl"] .brand {
  text-align: right;
}

[dir="rtl"] .topbar {
  direction: rtl;
}

[dir="rtl"] .admin-link {
  direction: rtl;
}

/* ===== 双语显示（主语言 + Bahasa Melayu 一对一对照） ===== */
[data-i18n] {
  white-space: pre-line;
}

/* 字段辅助提示 */
.field-hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
}

/* 3 天内提交规定提示 */
.notice-three-day {
  background: #fff4e5;
  border-left: 6px solid var(--gold);
  color: #7a5200;
  font-weight: 700;
}

/* 成功页订单凭据 */
.order-number-box {
  margin: 10px 0 20px;
}

.order-number-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.twelve-hours {
  margin: 18px 0 6px;
  background: #eef6ff;
  border: 1px solid #cfe3ff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: #1d3a63;
}

/* ===== 马来西亚主题装饰：国旗色带 + 背景纹理 ===== */
body::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    #cc0001 0px, #cc0001 22px,
    #ffffff 22px, #ffffff 44px
  );
}

body {
  background-color: #eef1f6;
  background-image:
    linear-gradient(rgba(11, 44, 92, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 193, 78, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
}

@media (max-width: 640px) {
  .language-grid {
    grid-template-columns: 1fr;
  }

  .grid.two,
  .grid.three,
  .card-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 14px 16px;
  }

  form {
    padding: 18px;
  }
}

/* ===== 版本标记（右下角红色框） ===== */
.version-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  z-index: 3000;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

/* ===== 表单页：吉隆坡（马来西亚首都）虚化背景 ===== */
.form-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #0b2c5c 0%, #123a73 55%, #e0813f 80%, #f2c14e 100%);
}

.form-bg svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(7px) brightness(0.95);
  transform: scale(1.08);
}
