/* ==========================================================================
   MAJI (마지) — Smart Wedding Hospitality & Reception System
   Minimalist Modern Luxury Design System
   ========================================================================== */

/* 웹폰트는 각 페이지 <head>의 <link>로 불러온다(Pretendard: jsDelivr, Cormorant/Montserrat: Google Fonts). */

:root {
  /* Surfaces & Backgrounds (Clean, Calming Warm Tones) */
  --bg-color: #FBFBFA;
  --bg-subtle: #F5F4F0;
  --card-bg: #FFFFFF;

  /* Typography Colors (Refined Deep Charcoal & Ink) */
  --primary: #191817;
  --text-main: #242220;
  --text-secondary: #635F59;
  --text-muted: #6E6A63;

  /* Subtle Warm Champagne Accent (Understated & Elegant) */
  --gold: #7E6438;
  --gold-light: #F7F4ED;
  --gold-mid: #A88854;
  --gold-dark: #6E5328;
  --gold-border: rgba(150, 120, 72, 0.22);
  --gold-gradient: #7E6438;
  --gold-gradient-soft: #7E6438;

  /* Functional Status Accents */
  --border: #E8E5DD;
  --border-subtle: #F0ECE4;
  --success: #2E6B41;
  --success-bg: #EDF6F0;
  --success-border: #C8E3CF;
  --danger: #B43434;
  --danger-bg: #FDF2F2;

  /* Geometry & Elevation (Crisp, Unified Rhythm) */
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(25, 24, 23, 0.04);
  --shadow: 0 4px 20px rgba(25, 24, 23, 0.04);
  --shadow-pass: 0 12px 36px rgba(25, 24, 23, 0.08);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  inset: 0 !important;
}

/* Layout Containers */
.mobile-wrapper {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 32px 20px calc(48px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

.admin-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px calc(64px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}

.hall-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px calc(64px + env(safe-area-inset-bottom, 0px));
  overflow-x: clip;
}

/* ==========================================================================
   Header & Editorial Branding
   ========================================================================== */
.brand-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-eyebrow {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.brand-title {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--primary);
  line-height: 1.25;
}

.brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 400;
}

/* ==========================================================================
   Standard Card Styles
   ========================================================================== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  position: relative;
  transition: box-shadow 0.2s ease;
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: #FFFFFF;
  color: var(--primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(150, 120, 72, 0.12);
}

.form-input::placeholder {
  color: #B2ACA2;
}

/* Quantity Selector */
.count-selector {
  display: flex;
  gap: 8px;
}

.count-btn {
  flex: 1;
  padding: 12px 0;
  min-height: 48px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.count-btn:hover {
  border-color: var(--gold-border);
  background: var(--bg-subtle);
}

.count-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 600;
}

/* Primary Action Buttons */
.btn-primary {
  width: 100%;
  min-height: 50px;
  padding: 14px 20px;
  background: var(--primary);
  color: #FFFFFF;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  background: #2D2B29;
  border-color: #2D2B29;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #FFFFFF;
}

.btn-gold:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

/* ==========================================================================
   Refined VIP Dining Pass
   ========================================================================== */
.vip-pass {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pass);
  position: relative;
}

.vip-pass-header {
  background: #191817;
  color: #FFFFFF;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
}

.pass-eyebrow {
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 600;
  color: #D2BA95;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.pass-couple {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 26px;
  letter-spacing: 1px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
}

.pass-venue {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
  font-weight: 400;
}

/* Pass Body */
.vip-pass-body {
  padding: 28px 24px 24px;
  text-align: center;
  background: #FFFFFF;
}

.pass-guest-label {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.pass-guest-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.3px;
}

.pass-guest-rel {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Meal Count Badge */
.pass-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--gold-light);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 18px 0;
}

.pass-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* Perforated Line Separator */
.perforated-container {
  position: relative;
  margin: 16px 0 20px;
}

.perforated-line {
  border-top: 1px dashed var(--border);
}

/* Scannable QR Container */
.barcode-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin: 16px 0 12px;
}

.qr-frame {
  background: #FFFFFF;
  padding: 10px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.barcode-num {
  font-family: 'Montserrat', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  margin-top: 12px;
}

/* Anti-Screenshot Verification Bar */
.live-security-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  margin-top: 8px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* Tags & Badges */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.tag.pending { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.tag.approved { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.tag.used { background: #F1F1F0; color: #6E6D6A; border: 1px solid #E5E4E2; }
.tag.rejected { background: var(--danger-bg); color: var(--danger); border: 1px solid #FED7D7; }

/* Status Banners */
.status-banner {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  line-height: 1.5;
}

.status-banner.waiting {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.status-banner.restore {
  background: #F0F7FF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Admin Dashboard & Reception Tablet
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-val {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
}

.ticket-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.ticket-table th,
.ticket-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}

.ticket-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  touch-action: manipulation;
}

.btn-sm:hover { opacity: 0.85; }
.btn-approve { background: var(--success); color: #FFFFFF; }
.btn-reject { background: var(--danger); color: #FFFFFF; }

/* PIN Lock Modal */
.pin-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(20, 19, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(24px, env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  max-width: 360px;
  width: 100%;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  margin: min(5vh, 32px) auto 24px;
  flex-shrink: 0;
  touch-action: pan-y;
}

.pin-input {
  font-family: 'Montserrat', monospace;
  font-size: 28px;
  letter-spacing: 6px;
  text-align: center;
  width: 100%; max-width: 240px; box-sizing: border-box;
  margin: 18px auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--primary);
}

.pin-input:focus {
  border-color: var(--gold);
}

/* Glass & Card Utilities */
.luxury-glass {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.luxury-glass-dark {
  background: rgba(25, 24, 23, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.metric-card-lux {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-card-lux:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.status-pill.pending {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.status-pill.approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-pill.used {
  background: #F1F1F0;
  color: #6E6D6A;
  border: 1px solid #E5E4E2;
}

.status-pill.rejected {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #FED7D7;
}

/* Toast Feedback */
.toast-notice {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #191817;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 10000;
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}

.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Shared Utilities (app.js / pass.js)
   ========================================================================== */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.toast-notice[data-kind="error"] { background: var(--danger); }

.form-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin: -6px 0 14px;
}

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

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

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
}

.state-box {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.state-box h2 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 6px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, #ECEAE4 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.pass-qr {
  display: block;
  width: 184px;
  height: 184px;
  image-rendering: pixelated;
}

.pass-used .vip-pass-body { opacity: 0.6; }
/* 입장한 식권은 QR을 숨겨 다시 내밀지 않게 한다 (번호와 '입장 완료' 표시는 남긴다) */
.pass-used .qr-frame, .pass-used .qr-hint { display: none; }

.toast-notice.has-action {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 20px;
}

.toast-action {
  background: rgba(255, 255, 255, 0.14);
  color: #FFF;
  border: none;
  border-radius: var(--radius-pill);
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* ==========================================================================
   Touch Targets — 모든 버튼·링크 최소 44px (페이지별 스타일보다 우선하도록 html body 접두)
   ========================================================================== */
html body :is(.btn-copy, .map-btn, .quick-btn, .ai-chip, .hall-action-btn, .header-link-btn, .nav-cta-btn,
  .btn-hero-secondary, .gate-btn, .nav-btn, .btn-sm, .desk-action-btn, .filter-tab-btn, .btn-upload-file,
  .console-back-link, .back-link, .print-btn, .btn-text) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
html body .btn-copy { min-width: 56px; padding: 0 12px; }
html body :is(.nav-menu a, .landing-foot a) { min-height: 44px; display: inline-flex; align-items: center; }
html body .console-back-link, html body .back-link { padding-right: 8px; }

/* 랜딩 상단과 같은 MAJI 로고 (운영 화면·안내 페이지 공용) */
.site-logo {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
