/* 공통 인증 UI + 로그인/마이/결제 페이지 */

.auth-menu { display: flex; align-items: center; gap: 10px; }
.auth-link { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 999px; transition: all var(--dur-fast) var(--ease); }
.auth-login { color: var(--ink-700); }
.auth-login:hover { color: var(--navy-900); background: rgba(15,26,46,0.06); }
.auth-register { background: var(--navy-900); color: var(--cream-50); }
.auth-register:hover { background: var(--navy-800); }
.auth-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--gold-500), var(--gold-700)); color: var(--navy-950); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; }
.auth-name { font-size: 13px; color: var(--navy-900); }
.auth-logout { font-size: 12px; color: var(--ink-500); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--ink-200); }
.auth-logout:hover { border-color: var(--navy-900); color: var(--navy-900); }

/* Dark nav variant (랜딩/관리자) */
.dark-nav .auth-login { color: rgba(245,235,214,0.8); }
.dark-nav .auth-login:hover { background: rgba(245,235,214,0.1); color: var(--cream-50); }
.dark-nav .auth-register { background: var(--gold-600); color: var(--navy-950); }
.dark-nav .auth-register:hover { background: var(--gold-500); }
.dark-nav .auth-name { color: var(--cream-50); }
.dark-nav .auth-logout { color: rgba(245,235,214,0.65); border-color: rgba(245,235,214,0.2); }
.dark-nav .auth-logout:hover { color: var(--cream-50); border-color: rgba(245,235,214,0.5); }

/* ── Auth page (로그인 / 회원가입) ────────── */
.auth-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream-50);
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; min-height: auto; }
}
body.app-mode .auth-shell {
  min-height: auto;
}
.auth-side {
  background: radial-gradient(ellipse at 20% 30%, rgba(201,169,110,0.14), transparent 55%),
              linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: var(--cream-50);
  padding: clamp(40px, 6vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::after {
  content: "主";
  position: absolute;
  right: -40px; bottom: -60px;
  font-family: var(--font-serif);
  font-size: 360px;
  color: rgba(201,169,110,0.05);
  font-weight: 900;
}
@media (max-width: 860px) { .auth-side { display: none; } }
.auth-side .brand { color: var(--cream-50); z-index: 2; position: relative; }
.auth-side .brand-mark { background: var(--gold-600); color: var(--navy-900); }
.auth-side h2 {
  color: var(--cream-50);
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.35;
  z-index: 2; position: relative;
  margin-top: 40px;
}
.auth-side h2 em { color: var(--gold-500); font-style: italic; }
.auth-side .sub { color: rgba(245,235,214,0.65); font-size: 14px; line-height: 1.7; margin-top: 16px; max-width: 380px; z-index: 2; position: relative; }
.auth-side .quote { margin-top: auto; padding-top: 40px; font-size: 13px; color: rgba(245,235,214,0.5); z-index: 2; position: relative; }

.auth-form-wrap {
  display: grid;
  place-items: center;
  padding: clamp(32px, 5vw, 80px) clamp(20px, 5vw, 60px) clamp(48px, 6vw, 80px);
}
.auth-form-card {
  width: 100%;
  max-width: 420px;
}
@media (max-width: 860px) {
  .auth-form-wrap { padding: 32px 20px 48px; }
}
.auth-title {
  font-family: var(--font-serif, serif);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy-900);
  margin: 0 0 10px;
}
.auth-sub {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-500);
  margin: 0 0 26px;
}
@media (max-width: 860px) {
  .auth-title { font-size: 24px; }
  .auth-sub { font-size: 13px; margin-bottom: 22px; }
}

.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ink-200);
}
.auth-tab {
  padding: 10px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-400);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
}
.auth-tab.active { color: var(--navy-900); }
.auth-tab.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--navy-900);
}

.auth-form .field { margin-bottom: 16px; }
.auth-form input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-sm);
  font-size: 15px;
  background: #fff;
}
.auth-form input:focus { border-color: var(--gold-600); outline: none; box-shadow: 0 0 0 4px rgba(201,169,110,0.12); }
.auth-submit {
  width: 100%;
  padding: 15px;
  background: var(--navy-900);
  color: var(--cream-50);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--r-sm);
  margin-top: 8px;
  transition: all var(--dur) var(--ease);
}
.auth-submit:hover { background: var(--navy-800); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-error { color: var(--danger); font-size: 13px; margin: 8px 0; min-height: 18px; }
.auth-hint { text-align: center; margin-top: 20px; font-size: 13px; color: var(--ink-500); }
.auth-hint a { color: var(--gold-700); font-weight: 600; }

/* ── My page ─────────────────────────────── */
.my-shell { background: var(--ink-50); min-height: 100vh; }
.my-nav {
  background: #fff;
  border-bottom: 1px solid var(--ink-100);
  padding: calc(14px + env(safe-area-inset-top, 0)) calc(24px + env(safe-area-inset-right, 0)) 14px calc(24px + env(safe-area-inset-left, 0));
  position: sticky; top: 0; z-index: 50;
}
.my-nav-inner { min-width: 0; }
.my-nav .brand { min-width: 0; flex-shrink: 1; overflow: hidden; }
.my-nav-inner > div { min-width: 0; }
.my-nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.my-body { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }

.my-head {
  display: flex; align-items: center; gap: 20px;
  padding: 28px; background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-xl);
  margin-bottom: 24px;
}
.my-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--navy-950);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 900;
}
.my-head h2 { font-family: var(--font-sans); font-size: 20px; font-weight: 700; }
.my-head .email { color: var(--ink-500); font-size: 14px; margin-top: 4px; }

.my-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 780px) { .my-grid { grid-template-columns: 1fr; } }

.my-section {
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.my-section h3 { font-family: var(--font-sans); font-size: 16px; font-weight: 700; color: var(--navy-900); margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.my-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--ink-100);
  font-size: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.my-item:last-child { border-bottom: none; }
.my-item .k { color: var(--ink-700); }
.my-item .v { color: var(--navy-900); font-weight: 500; }
.my-empty { padding: 32px; text-align: center; color: var(--ink-400); font-size: 14px; }

/* ── Pay page ────────────────────────────── */
.pay-shell { background: var(--cream-50); min-height: 100vh; }
.pay-body { max-width: 880px; margin: 0 auto; padding: 48px 24px 80px; }
.pay-head { text-align: center; margin-bottom: 40px; }
.pay-head h1 { font-size: clamp(28px, 3.4vw, 36px); font-weight: 800; }
.pay-head p { color: var(--ink-500); font-size: 15px; margin-top: 10px; }

.product-list { display: grid; gap: 14px; }
.product-card {
  background: #fff;
  border: 2px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.product-card:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.product-card.selected { border-color: var(--gold-600); background: linear-gradient(180deg, #fffbf3, #fff); box-shadow: 0 10px 30px -10px rgba(201,169,110,0.35); }
.product-card h4 { font-family: var(--font-sans); font-size: 17px; font-weight: 700; color: var(--navy-900); }
.product-card .desc { color: var(--ink-500); font-size: 14px; margin-top: 6px; line-height: 1.6; }
.product-card .price {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-900);
  white-space: nowrap;
}
.product-card .price small { font-family: var(--font-sans); font-size: 14px; color: var(--ink-500); font-weight: 500; margin-left: 4px; }

.pay-btn {
  margin-top: 32px;
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--navy-950);
  font-size: 17px;
  font-weight: 800;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-gold);
  transition: all var(--dur) var(--ease);
}
.pay-btn:hover { transform: translateY(-2px); }
.pay-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.pay-terms {
  margin-top: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
}
.pay-terms-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-700);
  cursor: pointer;
  padding: 6px 0;
}
.pay-terms-row.sub {
  font-size: 13px;
  color: var(--ink-600);
  padding-left: 4px;
}
.pay-terms-row:not(.sub) + .pay-terms-row.sub {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--ink-100);
}
.pay-terms-row input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--gold-600);
  flex-shrink: 0;
}
.pay-terms-row a {
  color: var(--gold-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pay-note {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fdfaf2;
  border: 1px solid #ede0bf;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: #6f4a14;
  line-height: 1.7;
}
.pay-note a { color: var(--gold-700); text-decoration: underline; }

.pay-result {
  background: #fff;
  border-radius: var(--r-xl);
  padding: clamp(40px, 6vw, 60px);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.pay-result-icon {
  width: 80px; height: 80px; margin: 0 auto 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
}
.pay-result.success .pay-result-icon { background: linear-gradient(135deg, #7dd3a0, #2d8a54); }
.pay-result.fail .pay-result-icon { background: linear-gradient(135deg, #e79595, #b94343); }
.pay-result h2 { font-size: 24px; margin-bottom: 10px; }
.pay-result .detail {
  background: var(--ink-50);
  border-radius: var(--r-sm);
  padding: 20px; margin: 24px 0;
  text-align: left;
  font-size: 14px;
  color: var(--ink-700);
  display: grid; gap: 8px;
}
.pay-result .detail strong { color: var(--navy-900); }
.pay-result-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Admin orders chip ───────────────────── */
.status-chip { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.status-chip.paid    { background: #d8f0e2; color: #1a6238; }
.status-chip.pending { background: #f0e5cd; color: #715930; }
.status-chip.failed  { background: #f5d6d6; color: #8a2a2a; }
.status-chip.canceled { background: #d8dbe3; color: #3d4761; }

/* ─── Mobile optimization (auth/my/pay pages) ─── */
@media (max-width: 640px) {
  .my-nav { padding: 10px 16px; }
  .my-nav-inner { gap: 10px; }
  .my-nav-inner > div { gap: 8px; }
  .my-nav-inner > div > a:not(.auth-link):not(.auth-register) { display: none; }
  .my-body, .pay-body { padding: 24px 14px 60px; }
  .my-head { padding: 20px; gap: 14px; border-radius: 14px; }
  .my-avatar { width: 52px; height: 52px; font-size: 22px; }
  .my-head h2 { font-size: 17px; }
  .my-head .email { font-size: 13px; }
  .my-section { padding: 18px 20px; border-radius: 14px; }
  .my-section h3 { font-size: 14.5px; }
  .my-item { padding: 12px 0; font-size: 13px; flex-wrap: wrap; gap: 8px; }

  /* 로그인 페이지 */
  .auth-form-wrap { padding: 32px 18px; }
  .auth-form-card { max-width: 100%; }
  .auth-tabs { gap: 20px; margin-bottom: 22px; }
  .auth-tab { font-size: 15px; }
  .auth-form .field { margin-bottom: 14px; }
  .auth-form input { padding: 13px 14px; }

  /* 결제 페이지 */
  .pay-head h1 { font-size: 24px; }
  .pay-head p { font-size: 14px; }
  .product-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
  }
  .product-card .price { font-size: 24px; }
  .product-card h4 { font-size: 16px; }
  .product-card .desc { font-size: 13.5px; }
  .pay-btn { padding: 16px; font-size: 15px; }
  .pay-note { padding: 14px 16px; font-size: 12.5px; }
  .pay-result { padding: 32px 22px; }
  .pay-result h2 { font-size: 20px; }
  .pay-result-actions { flex-direction: column; gap: 8px; }
  .pay-result-actions a, .pay-result-actions button { width: 100%; }
}
