:root {
  --rain-blue: #5bb8f5;
  --rain-mid: #89cff0;
  --rain-light: #c8e9fa;
  --rain-pale: #e8f5fd;
  --rain-dark: #2a7ab8;
  --sky-bg: #d4eefb;
  --text-dark: #2c4a60;
  --text-mid: #5a8aaa;
  --text-light: #8ab8cc;
  --nav-border: rgba(91, 184, 245, 0.26);
  --nav-link-hover: rgba(91, 184, 245, 0.12);
  --auth-surface: rgba(255,255,255,0.9);
  --auth-border: rgba(91,184,245,0.16);
  --auth-shadow: 0 10px 30px rgba(37,99,235,0.12);
  --auth-text: #17324d;
  --auth-muted: #6283a1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #f0f8ff 0%, #e8f5fd 40%, #ddf0fb 100%);
  min-height: 100vh;
  color: var(--text-dark);
  padding-top: 80px;
}

/* 키보드 접근성: focus-visible 링 복원 */
:focus-visible {
  outline: 2px solid var(--rain-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Navbar ── */
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

nav.navbar-liquid {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 10px); left: 1rem; right: 1rem;
  z-index: 1050;
  background: transparent !important;
  border: none;
  border-radius: 20px;
  box-shadow: none;
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  overflow: visible !important;
}
nav.navbar-liquid::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--nav-border);
  box-shadow: 0 8px 32px rgba(91, 184, 245, 0.18), 0 2px 8px rgba(0,0,0,0.06);
  z-index: -1;
  pointer-events: none;
}
nav.navbar-liquid .navbar-brand {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none;
  flex-shrink: 0;
}
nav.navbar-liquid .navbar-brand img {
  height: 32px !important;
  width: 32px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  filter: invert(52%) sepia(60%) saturate(500%) hue-rotate(185deg) brightness(95%);
  transition: transform 0.3s;
}
nav.navbar-liquid .navbar-brand:hover img { transform: rotate(-15deg) scale(1.1); }
nav.navbar-liquid .brand-name {
  font-family: 'Black Han Sans', sans-serif;
  font-size: 1.15rem;
  color: var(--rain-blue);
  letter-spacing: 2px;
  white-space: nowrap;
}
nav.navbar-liquid .navbar-toggler {
  border: none !important;
  padding: 5px 7px !important;
  background: rgba(255,255,255,0.54) !important;
  border-radius: 12px;
  box-shadow: none !important;
}
nav.navbar-liquid .nav-link {
  color: var(--text-dark) !important;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 20px;
  padding: 6px 13px !important;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
nav.navbar-liquid .nav-link:hover,
nav.navbar-liquid .nav-link:focus {
  color: var(--rain-dark) !important;
  background: var(--nav-link-hover);
}
nav.navbar-liquid .dropdown-menu {
  background: rgba(255,255,255,0.98) !important;
  border: 1.5px solid var(--nav-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 34px rgba(91,184,245,0.16) !important;
  padding: 8px !important;
}
nav.navbar-liquid .dropdown-item {
  color: var(--text-dark) !important;
  font-size: 0.86rem;
  border-radius: 8px;
  padding: 8px 14px !important;
}
nav.navbar-liquid .dropdown-item:hover {
  background: var(--nav-link-hover) !important;
  color: var(--rain-dark) !important;
}
nav.navbar-liquid .nav-main { flex: 1; justify-content: center; }
@media (max-width: 991.98px) {
  nav.navbar-liquid .nav-main { flex: unset; justify-content: flex-start; }
  nav.navbar-liquid .navbar-collapse {
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(232,245,253,0.96)) !important;
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    padding: 0.75rem 0.75rem 1.25rem !important;
    box-shadow: 0 18px 36px rgba(91,184,245,0.18);
    margin: 0.5rem 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  nav.navbar-liquid .navbar-nav { gap: 2px; }
  nav.navbar-liquid .nav-link { border-radius: 10px !important; padding: 8px 14px !important; }
  nav.navbar-liquid .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    background: rgba(91,184,245,0.04) !important;
    border-radius: 10px !important;
    margin: 4px 0 4px 10px !important;
    padding: 4px !important;
  }
  #authNavbar {
    width: 100% !important; margin-left: 0 !important;
    padding-top: 10px; border-top: 1px solid rgba(91,184,245,0.15); margin-top: 6px;
  }
}

/* Auth section */
#authNavbar { align-items: center; }
#authNavbar .auth-profile-toggle,
#authNavbar .auth-guest-shell {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(91,184,245,0.18);
}
#authNavbar .auth-profile-toggle:hover,
#authNavbar .auth-guest-shell:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(91,184,245,0.18);
}
#authNavbar .auth-dropdown-menu { margin-top: 10px; }

.auth-nav-item { display: flex; align-items: center; }

.auth-profile-toggle,
.auth-guest-shell {
  display: inline-flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px !important;
  border-radius: 18px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: var(--auth-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: var(--auth-text) !important;
}
.auth-profile-toggle:hover,
.auth-guest-shell:hover {
  color: var(--auth-text) !important;
  text-decoration: none;
}
.auth-profile-toggle::after { margin-left: 2px; }

.auth-profile-left,
.auth-profile-right { display: inline-flex; align-items: center; }
.auth-profile-left { gap: 10px; min-width: 0; }
.auth-profile-right { gap: 8px; margin-left: auto; min-width: 0; }

.auth-user-name {
  color: var(--auth-text);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 5px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.auth-role-badge--user  { background: linear-gradient(135deg, #0f766e, #0f9f93); }
.auth-role-badge--admin { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }
.auth-role-badge--guest { background: linear-gradient(135deg, #f59e0b, #ea580c); }

.auth-role-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 12px; flex-shrink: 0;
}
.auth-role-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
}
.auth-role-icon--user {
  background: linear-gradient(135deg, #dcfce7, #ccfbf1);
  color: #0f766e;
  border: 1px solid rgba(15,118,110,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 6px 14px rgba(15,118,110,0.12);
}
.auth-role-icon--admin {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
  border: 1px solid rgba(29,78,216,0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 6px 14px rgba(29,78,216,0.14);
}
.auth-role-indicator { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.auth-role-text {
  color: var(--auth-text);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.auth-login-link {
  display: inline-flex !important;
  align-items: center; justify-content: center;
  gap: 8px; padding: 0 !important;
  font-size: 0.9rem; font-weight: 800;
  color: var(--auth-text) !important;
  text-decoration: none;
}
.auth-action-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex-shrink: 0; color: #5a83aa;
}
.auth-action-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.auth-login-link .auth-action-icon { color: var(--auth-text); }
.auth-action-link:hover .auth-action-icon,
.auth-login-link:hover .auth-action-icon { color: #1d4ed8; }
.auth-action-link { display: flex !important; align-items: center; gap: 10px; }

.auth-dropdown-menu.dropdown-menu { min-width: 220px; }
.auth-dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px 12px;
}
.auth-dropdown-label {
  color: var(--auth-muted); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.auth-dropdown-role { color: var(--auth-text); font-size: 0.85rem; }

@media (max-width: 576px) {
  .auth-profile-toggle, .auth-guest-shell { width: 100%; justify-content: space-between; }
  .auth-nav-item, .auth-nav-item--guest { width: 100%; }
}

/* ── Page layout ── */
.page-container { max-width: 560px; margin: 0 auto; padding: 2rem 1rem 4rem; }

/* ── Cards ── */
.dr-card {
  background: rgba(255,255,255,0.92);
  border: 1.5px solid rgba(91,184,245,0.18);
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(91,184,245,0.12), 0 2px 8px rgba(0,0,0,0.04);
  padding: 1.75rem;
}
.dr-card + .dr-card { margin-top: 1rem; }

/* ── Tabs ── */
.dr-tabs {
  display: flex; gap: 0; background: rgba(255,255,255,0.7);
  border-radius: 14px; padding: 4px;
  border: 1px solid rgba(91,184,245,0.15); margin-bottom: 1.5rem;
  role: tablist;
}
.dr-tab {
  flex: 1; padding: 9px 0; border-radius: 10px; border: none; background: transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-mid);
  cursor: pointer; transition: all 0.2s;
}
.dr-tab.active {
  background: rgba(91,184,245,0.18);
  color: var(--rain-dark);
  box-shadow: 0 2px 8px rgba(91,184,245,0.12);
}
.dr-tab:focus-visible {
  outline: 2px solid var(--rain-blue);
  outline-offset: -2px;
}

/* ── Form ── */
.dr-label { font-size: 0.84rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; display: block; }
.dr-label-sub { font-size: 0.75rem; font-weight: 400; color: var(--text-mid); margin-left: 4px; }
.dr-input {
  width: 100%; background: rgba(240,248,255,0.8); border: 1.5px solid rgba(91,184,245,0.22);
  border-radius: 12px; padding: 12px 16px; font-family: inherit; font-size: 0.9rem;
  color: var(--text-dark); outline: none; transition: border 0.2s, box-shadow 0.2s;
}
.dr-input:focus { border-color: var(--rain-blue); box-shadow: 0 0 0 3px rgba(91,184,245,0.14); }
.dr-input::placeholder { color: var(--text-light); }
.dr-input-wrap { position: relative; }
.dr-input-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-mid); font-size: 0.85rem; }

.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.preset-btn {
  padding: 10px; border-radius: 12px; border: 1.5px solid rgba(91,184,245,0.22);
  background: rgba(240,248,255,0.6); font-family: inherit; font-size: 0.85rem;
  font-weight: 600; color: var(--text-mid); cursor: pointer; transition: all 0.15s;
}
.preset-btn:hover { border-color: var(--rain-blue); color: var(--rain-dark); background: rgba(91,184,245,0.08); }
.preset-btn.selected { background: var(--rain-blue); color: #fff; border-color: var(--rain-blue); box-shadow: 0 4px 12px rgba(91,184,245,0.35); }

.dr-btn {
  width: 100%; padding: 14px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, var(--rain-blue), var(--rain-dark));
  color: #fff; font-family: inherit; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 6px 18px rgba(91,184,245,0.35);
}
.dr-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(91,184,245,0.45); }
.dr-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-error {
  display: none; background: rgba(254,226,226,0.8); border: 1.5px solid rgba(239,68,68,0.2);
  border-radius: 12px; padding: 12px 16px; font-size: 0.85rem; color: #dc2626;
}

/* ── Payment info card (after order) ── */
.info-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.info-header .badge-status { padding: 6px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge-PENDING   { background: rgba(251,191,36,0.15); color: #b45309; border: 1px solid rgba(251,191,36,0.35); }
.badge-COMPLETED { background: rgba(74,222,128,0.15); color: #15803d; border: 1px solid rgba(74,222,128,0.35); }
.badge-FAILED    { background: rgba(248,113,113,0.15); color: #dc2626; border: 1px solid rgba(248,113,113,0.35); }
.badge-CANCELLED { background: rgba(148,163,184,0.15); color: #475569; border: 1px solid rgba(148,163,184,0.35); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-cell {
  background: rgba(240,248,255,0.7); border: 1px solid rgba(91,184,245,0.15);
  border-radius: 12px; padding: 12px 14px;
  min-width: 0; /* flex/grid overflow 방지 */
}
.info-cell-label { font-size: 0.72rem; color: var(--text-mid); font-weight: 500; margin-bottom: 4px; }
.info-cell-value { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); word-break: break-all; }
.info-cell-value.mono { font-family: 'Courier New', monospace; }
.info-cell-value.accent { color: var(--rain-dark); font-size: 1rem; }
.info-cell.full { grid-column: 1 / -1; }

.warn-box {
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.warn-box p { font-size: 0.78rem; color: #92400e; margin: 0; line-height: 1.6; }
.warn-box p + p { margin-top: 4px; }

/* ── Timeline ── */
.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 1.25rem; }
.tl-step { display: flex; gap: 14px; align-items: flex-start; }
.tl-step + .tl-step { margin-top: 0; }
.tl-left { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 30px; }
.tl-dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0; border: 2px solid transparent;
}
.tl-dot.done   { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.5); color: #15803d; }
.tl-dot.active { background: rgba(91,184,245,0.15); border-color: var(--rain-blue); color: var(--rain-dark); }
.tl-dot.wait   { background: rgba(148,163,184,0.1); border-color: rgba(148,163,184,0.3); color: #94a3b8; }
.tl-line { width: 2px; flex: 1; min-height: 24px; background: rgba(91,184,245,0.15); margin: 2px 0; }
.tl-body { padding-bottom: 1.25rem; min-width: 0; }
.tl-step:last-child .tl-body { padding-bottom: 0; }
.tl-title { font-size: 0.88rem; font-weight: 700; color: var(--text-dark); }
.tl-desc  { font-size: 0.78rem; color: var(--text-mid); margin-top: 2px; }

/* ── Order list ── */
.order-card {
  background: rgba(255,255,255,0.85);
  border: 1.5px solid rgba(91,184,245,0.15);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.order-card:hover { border-color: var(--rain-blue); box-shadow: 0 6px 18px rgba(91,184,245,0.14); transform: translateY(-1px); }
.order-card:focus-visible { outline: 2px solid var(--rain-blue); outline-offset: 2px; }
.order-card + .order-card { margin-top: 10px; }
.order-card.pending-card { border-color: rgba(91,184,245,0.35); background: rgba(232,245,253,0.6); }
.order-card.pending-card:hover { border-color: var(--rain-blue); background: rgba(232,245,253,0.85); }

/* ── Pagination ── */
.pagination-wrap { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 1.25rem; flex-wrap: wrap; }
.pg-btn {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px;
  border: 1.5px solid rgba(91,184,245,0.22); background: rgba(255,255,255,0.8);
  font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-mid);
  cursor: pointer; transition: all 0.15s; display: flex; align-items: center; justify-content: center;
}
.pg-btn:hover { border-color: var(--rain-blue); color: var(--rain-dark); background: rgba(91,184,245,0.08); }
.pg-btn.active { background: var(--rain-blue); color: #fff; border-color: var(--rain-blue); box-shadow: 0 3px 10px rgba(91,184,245,0.3); }
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pg-info { font-size: 0.78rem; color: var(--text-mid); padding: 0 4px; }

/* ── Views ── */
.view { display: none; }
.view.active { display: block; animation: fadeUp 0.22s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── Loading spinner ── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(91,184,245,0.2);
  border-top-color: var(--rain-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 3rem auto; display: block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ── */
.section-title { font-size: 1.1rem; font-weight: 800; color: var(--text-dark); margin-bottom: 1.25rem; }
.divider { border: none; border-top: 1px solid rgba(91,184,245,0.15); margin: 1rem 0; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; font-family: inherit;
  font-size: 0.85rem; color: var(--text-mid); cursor: pointer; margin-bottom: 1.25rem;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--rain-dark); }
.empty-state { text-align: center; padding: 3rem 0; color: var(--text-mid); font-size: 0.9rem; }
.empty-state .icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; opacity: 0.5; }
.legal-note { font-size: 0.72rem; color: var(--text-light); margin-top: 0.75rem; text-align: center; }
.refresh-btn {
  background: none; border: 1px solid rgba(91,184,245,0.3); border-radius: 8px;
  padding: 4px 10px; font-family: inherit; font-size: 0.78rem; color: var(--rain-dark);
  cursor: pointer; transition: all 0.15s;
}
.refresh-btn:hover { background: rgba(91,184,245,0.08); }

/* ── 모바일 반응형 ── */
@media (max-width: 400px) {
  .info-grid { grid-template-columns: 1fr; }
  .info-cell.full { grid-column: 1; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .info-cell-value.mono { font-size: 0.78rem; }
  .dr-card { padding: 1.25rem; }
}

@media (max-width: 360px) {
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .pg-btn { min-width: 30px; height: 30px; font-size: 0.75rem; }
}
