/* ===================================================================
   ITC Shirt Registration Form - form.peakbrosmao.me
   Design System: Default Light Mode with Sleek Dark Mode Support
   =================================================================== */

/* -------------------------------------------------------------------
   1. Design Tokens & Theme Variables (Default: Light Mode)
   ------------------------------------------------------------------- */
:root, [data-theme="light"] {
  /* Surface & Background (Light) */
  --bg-dark: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --header-bg: rgba(255, 255, 255, 0.9);
  --border-glass: rgba(15, 23, 42, 0.08);
  --border-focus: #0284c7;
  
  /* Form Inputs (Light) */
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-text: #0f172a;
  --input-placeholder: #94a3b8;

  /* Primary & Accents */
  --primary: #0284c7;
  --primary-light: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.15);
  --accent-gold: #d97706;
  --accent-gold-glow: rgba(217, 119, 6, 0.15);
  --itc-blue: #0055b3;
  --itc-crimson: #c51b24;

  /* Text & Typography (Light) */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --hero-title-grad: linear-gradient(135deg, #0f172a 40%, #0369a1 80%, #0284c7 100%);
  --badge-bg: rgba(2, 132, 199, 0.08);
  --badge-border: rgba(2, 132, 199, 0.2);

  /* Status */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  /* Shadows */
  --shadow-subtle: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(0, 0, 0, 0.03);
  --ambient-opacity: 0.12;

  /* Fonts */
  --font-khmer: 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-moul: 'Moul', 'Khmer OS Muol Light', serif;
  --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* -------------------------------------------------------------------
   2. Dark Mode Override
   ------------------------------------------------------------------- */
[data-theme="dark"] {
  /* Surface & Background (Dark) */
  --bg-dark: #0a0f1d;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(26, 36, 56, 0.9);
  --header-bg: rgba(10, 15, 29, 0.88);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-focus: #38bdf8;

  /* Form Inputs (Dark) */
  --input-bg: rgba(15, 23, 42, 0.7);
  --input-border: rgba(255, 255, 255, 0.14);
  --input-text: #f8fafc;
  --input-placeholder: #64748b;

  /* Primary & Accents */
  --primary: #0284c7;
  --primary-light: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);

  /* Text & Typography (Dark) */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --hero-title-grad: linear-gradient(135deg, #ffffff 40%, #93c5fd 80%, #38bdf8 100%);
  --badge-bg: rgba(56, 189, 248, 0.1);
  --badge-border: rgba(56, 189, 248, 0.25);

  /* Shadows */
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --ambient-opacity: 0.25;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-khmer);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ambient Glow Elements */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  z-index: 0;
  opacity: var(--ambient-opacity);
  transition: opacity 0.3s ease;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.6), transparent 70%);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.5), transparent 70%);
  bottom: 50px;
  right: -150px;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent 70%);
  top: 40%;
  left: 30%;
}

/* ===================================================================
   Header Navigation
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 12px 24px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-container {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ITC Brand Badge (Left) */
.header-left {
  display: flex;
  align-items: center;
}

.itc-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  padding: 6px 18px 6px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.itc-logo-box {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.itc-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.itc-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}

.itc-main {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.itc-sub {
  font-size: 9.5px;
  font-family: var(--font-en);
  font-weight: 600;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
}

/* Theme Toggle Button (Right) */
.header-right {
  display: flex;
  align-items: center;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-family: var(--font-khmer);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  color: var(--accent-gold);
}

[data-theme="dark"] .theme-toggle-btn svg {
  color: var(--primary-light);
}

.hidden {
  display: none !important;
}

/* ===================================================================
   Main Layout & Hero
   =================================================================== */
.main-wrapper {
  max-width: 1300px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  position: relative;
  z-index: 1;
}

.hero-section {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--primary-light);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 12px;
  background: var(--hero-title-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.7;
}

.hero-desc strong {
  color: var(--accent-gold);
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: start;
}

/* Card Foundation */
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  transition: var(--transition);
}

.card-glass:hover {
  border-color: rgba(2, 132, 199, 0.25);
}

/* Form Card */
.form-card {
  padding: 32px;
}

.card-header {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 18px;
}

.step-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
}

/* Form Controls */
.form-group {
  margin-bottom: 22px;
}

.form-group.compact {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-label.small {
  font-size: 13px;
  margin-bottom: 6px;
}

.req {
  color: var(--error);
  font-weight: bold;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.label-with-action .form-label {
  margin-bottom: 0;
}

.dept-count-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 600;
}

.input-wrap, .select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-svg {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  color: var(--text-dim);
}

.form-control {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--input-text);
  font-family: var(--font-khmer);
  font-size: 14.5px;
  outline: none;
  transition: var(--transition);
}

.form-control.small {
  padding: 9px 12px;
  font-size: 13.5px;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
  color: var(--input-placeholder);
  font-size: 13.5px;
}

.select-styled {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

[data-theme="dark"] .select-styled option {
  background-color: #0f172a;
  color: #fff;
}

[data-theme="light"] .select-styled option {
  background-color: #ffffff;
  color: #0f172a;
}

.input-hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-error {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  min-height: 16px;
}

/* Quick Group Buttons */
.quick-group-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quick-tag-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.group-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.group-btn:hover, .group-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
  transform: translateY(-1px);
}

/* Size Selector Grid */
.size-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.size-card {
  position: relative;
  cursor: pointer;
}

.size-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.size-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-align: center;
}

.size-card:hover .size-box {
  border-color: var(--primary);
}

.size-card input[type="radio"]:checked + .size-box {
  border-color: var(--primary);
  background: rgba(2, 132, 199, 0.1);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: translateY(-2px);
}

.size-name {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.size-spec {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: var(--font-en);
}

.size-card input[type="radio"]:checked + .size-box .size-name {
  color: var(--primary);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-family: var(--font-khmer);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}

.link-btn:hover {
  color: #0369a1;
}

/* Action Buttons */
.form-actions {
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-khmer);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

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

.btn-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 16px;
  font-size: 13.5px;
  flex: 1;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===================================================================
   Sidebar (Live Preview & PDF Tools)
   =================================================================== */
.sidebar-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.preview-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.preview-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-family: var(--font-en);
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--badge-bg);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--badge-border);
}

.shirt-graphic {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 20px;
}

.shirt-canvas {
  width: 190px;
  height: 190px;
  position: relative;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.shirt-canvas:hover {
  transform: scale(1.03);
}

.shirt-svg {
  width: 100%;
  height: 100%;
}

.summary-details {
  border-top: 1px solid var(--border-glass);
  padding-top: 16px;
}

.summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.summary-list {
  list-style: none;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border-glass);
}

.summary-list li:last-child {
  border-bottom: none;
}

.sum-label {
  color: var(--text-muted);
}

.sum-val {
  color: var(--text-main);
  font-weight: 600;
  max-width: 180px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-dept {
  color: var(--primary);
  font-family: var(--font-en);
  font-weight: 700;
}

.tag-grp {
  color: var(--accent-gold);
  font-weight: 700;
}

.tag-size {
  display: inline-block;
  padding: 2px 8px;
  background: var(--badge-bg);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-family: var(--font-en);
}

/* PDF Tools Card */
.export-tools-card {
  padding: 24px;
}

.tools-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-icon-box {
  width: 38px;
  height: 38px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.tools-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.tools-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.export-controls {
  margin-top: 10px;
}

.export-btn-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* ===================================================================
   Modal Popups
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  transition: opacity 0.2s ease;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-title.text-center {
  text-align: center;
}

.modal-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.chart-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.table-responsive {
  overflow-x: auto;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.size-table th, .size-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-glass);
}

.size-table th {
  background: var(--bg-dark);
  color: var(--text-main);
  font-weight: 600;
}

.size-table td {
  color: var(--text-muted);
}

.size-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--badge-bg);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-family: var(--font-en);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.modal-footer.center {
  justify-content: center;
}

/* Success Modal */
.modal-success {
  max-width: 440px;
}

.success-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.success-icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.success-summary-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}

.succ-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--border-glass);
}

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

.succ-row.highlight-row {
  background: var(--badge-bg);
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border-bottom: none;
}

.succ-row.highlight-row span {
  font-weight: 600;
  color: var(--primary);
}

.queue-badge {
  font-size: 16px;
  color: var(--primary);
  font-family: var(--font-en);
}

.succ-row span {
  color: var(--text-muted);
}

.succ-row strong {
  color: var(--text-main);
}

.modal-pdf-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

/* ===================================================================
   Footer
   =================================================================== */
.site-footer {
  border-top: 1px solid var(--border-glass);
  background: var(--header-bg);
  padding: 20px 24px;
  margin-top: 40px;
  position: relative;
  z-index: 10;
}

.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-right a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-en);
}

/* ===================================================================
   PRINTABLE PDF & PREVIEW SECTION
   Clean Official Layout:
   - Khmer Motto in Moul font, NO clumsy symbols
   - ITC Official seal logo & Khmer headers
   - Table with checkboxes [ ] for payment & receipt
   =================================================================== */
.print-area {
  display: none;
}

.print-area.preview-mode {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 300;
  overflow-y: auto;
  padding: 40px 20px;
}

.print-area.preview-mode .pdf-document {
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
  color: #000000;
  padding: 40px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  position: relative;
}

.pdf-document {
  background: #ffffff;
  color: #000000;
  font-family: 'Kantumruy Pro', 'Khmer OS Siemreap', Arial, sans-serif;
  line-height: 1.4;
}

.pdf-national-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}

.pdf-logo-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pdf-logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.motto-side.left {
  text-align: left;
}

.inst-khmer {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  margin-bottom: 2px;
}

.inst-en {
  font-size: 11px;
  font-weight: 700;
  color: #222;
  font-family: 'Outfit', Arial, sans-serif;
  letter-spacing: 0.5px;
}

.dept-sub-text {
  font-size: 12.5px;
  color: #333;
  margin-top: 4px;
}

.motto-side.right {
  text-align: center;
}

.motto-line-1 {
  font-family: 'Moul', 'Khmer OS Muol Light', serif;
  font-size: 15px;
  color: #000;
  margin-bottom: 4px;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.motto-line-2 {
  font-family: 'Moul', 'Khmer OS Muol Light', serif;
  font-size: 13.5px;
  color: #000;
  margin-bottom: 6px;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

.pdf-title-block {
  text-align: center;
  margin-bottom: 24px;
}

.pdf-main-title {
  font-size: 19px;
  font-weight: 800;
  color: #000;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.pdf-group-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  background: #f1f5f9;
  display: inline-block;
  padding: 4px 16px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  margin-bottom: 6px;
}

.pdf-date {
  font-size: 12px;
  color: #555;
  font-style: italic;
}

.pdf-table-wrap {
  margin-bottom: 30px;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #000;
}

.pdf-table th, .pdf-table td {
  border: 1px solid #000;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
}

.pdf-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.25;
}

.pdf-table th small {
  font-weight: normal;
  color: #333;
  display: block;
}

.pdf-table td.text-left {
  text-align: left;
  padding-left: 10px;
}

.checkbox-box {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1.8px solid #000;
  border-radius: 3px;
  background-color: #fff;
  vertical-align: middle;
}

.empty-price-line {
  display: inline-block;
  width: 70%;
  height: 1px;
  border-bottom: 1px dotted #888;
}

.pdf-footer-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  page-break-inside: avoid;
}

.sign-col {
  width: 45%;
  text-align: center;
  font-size: 13px;
}

.sign-role {
  font-weight: 700;
  margin-top: 4px;
}

.sign-space {
  height: 60px;
}

.sign-dots {
  color: #666;
}

/* Print Media Query */
@media print {
  body * {
    visibility: hidden;
  }

  .print-area, .print-area * {
    visibility: visible;
  }

  .print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent !important;
  }

  .pdf-document {
    padding: 20mm 15mm;
    box-shadow: none !important;
    max-width: 100% !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm;
  }
}

/* Responsive */
@media (max-width: 992px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-left, .header-right {
    justify-content: center;
  }

  .itc-badge {
    width: 100%;
    justify-content: center;
  }

  .hero-title {
    font-size: 26px;
  }

  .form-card {
    padding: 20px 16px;
  }

  .size-selector-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .export-btn-group {
    flex-direction: column;
  }
}
