/* ==========================================================================
   Tax invoice request form - modern responsive theme
   Used by: views/tax/*.ejs (and *_tme.ejs variants)
   ========================================================================== */

:root {
  --tax-primary: #b3001b;
  --tax-primary-dark: #8a0015;
  --tax-primary-soft: #fdecee;
  --tax-text: #1f2430;
  --tax-text-muted: #6b7280;
  --tax-border: #e2e5eb;
  --tax-bg: #f4f5f7;
  --tax-card-bg: #ffffff;
  --tax-radius: 14px;
  --tax-shadow: 0 2px 10px rgba(20, 20, 40, 0.06), 0 1px 2px rgba(20, 20, 40, 0.04);
  --tax-max-width: 720px;
}

/* Utility used by existing inline JS (classList add/remove('w3-hide')) */
.w3-hide {
  display: none !important;
}

.tax-body {
  background: var(--tax-bg);
  font-family: 'Kanit', sans-serif;
  color: var(--tax-text);
  min-height: 100vh;
  margin: 0;
}

/* ---------- Header ---------- */
.tax-header {
  background: linear-gradient(135deg, var(--tax-primary) 0%, var(--tax-primary-dark) 100%);
  color: #fff;
  padding: 22px 16px 26px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tax-header h1 {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.tax-header p {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
  font-weight: 300;
}

/* ---------- Layout ---------- */
.tax-wrap {
  max-width: var(--tax-max-width);
  margin: 0 auto;
  padding: 16px 14px 48px;
  box-sizing: border-box;
}

.tax-card {
  background: var(--tax-card-bg);
  border-radius: var(--tax-radius);
  box-shadow: var(--tax-shadow);
  padding: 20px;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.tax-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--tax-primary);
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tax-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tax-card-title .step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--tax-primary-soft);
  color: var(--tax-primary);
  font-size: 12px;
  flex: none;
}

/* ---------- Fields ---------- */
.tax-field {
  margin-bottom: 16px;
}

.tax-field:last-child {
  margin-bottom: 0;
}

.tax-label {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--tax-text-muted);
  margin-bottom: 6px;
}

.tax-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  color: var(--tax-text);
  padding: 12px 14px;
  border: 1.5px solid var(--tax-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tax-input:focus {
  outline: none;
  border-color: var(--tax-primary);
  box-shadow: 0 0 0 3px var(--tax-primary-soft);
}

.tax-input.uppercase {
  text-transform: uppercase;
}

/* two-column responsive grid for paired fields */
.tax-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .tax-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Choice / pill group (radio replacements) ---------- */
.tax-choice-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tax-choice {
  position: relative;
  flex: 1 1 auto;
  min-width: 140px;
}

.tax-choice input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.tax-choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 12px 14px;
  border: 1.5px solid var(--tax-border);
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--tax-text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tax-choice input:checked + label {
  border-color: var(--tax-primary);
  background: var(--tax-primary-soft);
  color: var(--tax-primary-dark);
  font-weight: 500;
}

.tax-choice input:focus-visible + label {
  box-shadow: 0 0 0 3px var(--tax-primary-soft);
}

/* ---------- Section divider ---------- */
.tax-section-header {
  font-size: 14px;
  font-weight: 500;
  color: var(--tax-text-muted);
  background: var(--tax-bg);
  padding: 8px 12px;
  border-radius: 8px;
  margin: 4px 0 16px;
}

/* ---------- Buttons ---------- */
.tax-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--tax-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 400;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.tax-btn:hover {
  background: var(--tax-primary-dark);
}

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

.tax-btn.secondary {
  background: #fff;
  color: var(--tax-text);
  border: 1.5px solid var(--tax-border);
}

.tax-btn.secondary:hover {
  background: var(--tax-bg);
}

.tax-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 480px) {
  .tax-actions.row {
    flex-direction: row;
  }
}

/* ---------- Summary (validate.ejs) ---------- */
.tax-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--tax-border);
  font-size: 14.5px;
}

.tax-summary-row:last-child {
  border-bottom: none;
}

.tax-summary-label {
  flex: 0 0 150px;
  color: var(--tax-text-muted);
}

.tax-summary-value {
  flex: 1 1 180px;
  font-weight: 400;
  word-break: break-word;
}

/* ---------- Order info block (compact, single-line rows) ---------- */
.tax-order-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 4px;
}

.tax-order-info-head .tax-section-header {
  margin: 0;
  flex: 1 1 auto;
}

.tax-order-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--tax-border);
  font-size: 14.5px;
}

.tax-order-row:last-child {
  border-bottom: none;
}

.tax-order-row .tax-summary-label {
  flex: 0 0 auto;
  color: var(--tax-text-muted);
  white-space: nowrap;
}

.tax-order-row .tax-summary-value {
  flex: 0 1 auto;
  font-weight: 400;
  text-align: right;
}

.tax-link-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  color: var(--tax-primary);
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  padding: 2px;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.tax-link-btn:hover {
  color: var(--tax-primary-dark);
}

/* ---------- Consent checkboxes ---------- */
.tax-consent {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--tax-border);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--tax-text-muted);
}

.tax-consent:last-of-type {
  border-bottom: none;
}

.tax-consent input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--tax-primary);
  cursor: pointer;
}

.tax-consent .note {
  font-size: 12.5px;
  color: var(--tax-text-muted);
  font-style: normal;
}

/* ---------- Status / message pages (exist, complete) ---------- */
.tax-status-card {
  text-align: center;
  padding: 40px 24px;
}

.tax-status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 26px;
  background: var(--tax-primary-soft);
  color: var(--tax-primary);
}

.tax-status-icon.success {
  background: #e6f6ec;
  color: #1a8a44;
}

.tax-status-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--tax-text);
  margin: 0 0 20px;
}

/* ---------- Misc ---------- */
.tax-hint {
  font-size: 12.5px;
  color: var(--tax-text-muted);
  margin-top: 6px;
}

.tax-hint-status {
  font-size: 13.5px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.5;
}

.tax-hint-status.tax-hint-error {
  background: var(--tax-primary-soft);
  color: var(--tax-primary-dark);
}

.tax-hint-status.tax-hint-success {
  background: #e6f6ec;
  color: #1a8a44;
}

.tax-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Platform badge (order info card) ---------- */
.tax-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--tax-text-muted);
}

.tax-platform-badge.shopee {
  background: #ee4d2d;
}

.tax-platform-badge.lazada {
  background: #0f146d;
}

.tax-platform-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 380px) {
  .tax-header h1 {
    font-size: 17px;
  }
  .tax-card {
    padding: 16px;
  }
}
