@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ===================== ROOT VARIABLES ===================== */
:root {
  --black: #111111;
  --white: #ffffff;
  --gray-50: #f9f9f9;
  --gray-100: #f2f2f2;
  --gray-200: #e5e5e5;
  --gray-400: #aaaaaa;
  --gray-600: #666666;
  --gold: #b59461;
  --gold-light: #d4b483;
  --error: #ff4444;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 24px rgba(0,0,0,0.06);
  --shadow-strong: 0 8px 32px rgba(0,0,0,0.12);
}

/* ===================== RESET ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ===================== ANIMATIONS ===================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ===================== AUTH SCREEN ===================== */
#auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  z-index: 1000;
  padding: 24px;
}

.auth-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.auth-container h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--black);
}

.auth-container > div > p,
.auth-container p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Input Group */
.input-group {
  position: relative;
  margin-bottom: 14px;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 17px 50px 17px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: var(--gray-50);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--black);
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--gray-400);
  letter-spacing: 0.1em;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--black);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

select {
  text-align: left;
  padding-right: 42px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gray-600) 50%), linear-gradient(135deg, var(--gray-600) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* 보안 코드 전용 */
#access-code {
  font-size: 1.5rem;
  letter-spacing: 0.25em;
  font-weight: 700;
  padding-right: 55px;
}

/* 매장명 입력창 */
#store-name {
  text-align: left;
  padding-left: 20px;
  letter-spacing: 0;
}

/* 토글 버튼 */
#toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  z-index: 5;
}
#toggle-pw:hover, #toggle-pw:active { color: var(--black); }
#toggle-pw svg { width: 20px; height: 20px; }

/* 기본 버튼 */
.btn-primary {
  width: 100%;
  padding: 17px 20px;
  border-radius: var(--radius-md);
  background: var(--black);
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 4px;
}
.btn-primary:active { transform: scale(0.98); background: #333; }
.btn-primary:disabled { background: var(--gray-400); cursor: not-allowed; }

/* 에러 메시지 */
#auth-error {
  font-size: 0.85rem;
  color: var(--error);
  margin-top: 12px;
  display: none;
}

/* ===================== MAIN SURVEY ===================== */
#main-content {
  display: none;
  min-height: 100vh;
  padding-top: 0;
  padding-bottom: 100px;
  background: var(--gray-50);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0;
}

/* 딜리버리 탭 내비게이션 */
.delivery-nav {
  display: flex;
  gap: 8px;
  padding: 14px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.delivery-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 100px;
  font-size: 0.88rem; /* 0.95rem -> 0.88rem (약간 축소) */
  font-weight: 700;   /* 800 -> 700 (적당히 두껍게) */
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid var(--gray-200); /* 2px -> 1.5px (얇게) */
  background: var(--white);
  color: var(--gray-600); /* var(--black) -> var(--gray-600) (부담 없게) */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-tab small {
  color: var(--gray-400);
  font-size: 0.68rem;
  font-weight: 800;
}
.nav-tab.complete {
  border-color: rgba(181, 148, 97, 0.35);
}
.nav-tab.complete small {
  color: var(--gold);
}
.nav-tab.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}
.nav-tab.active small { color: var(--gold-light); }

/* 진행바 */
.progress-bar-container {
  height: 3px;
  background: var(--gray-100);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-text {
  display: none; /* 깔끔하게 숫자 제거 */
}

/* ===================== SURVEY CONTAINER ===================== */
#survey-container {
  padding: 20px 16px 0;
  max-width: 520px;
  margin: 0 auto;
}

/* 상품 카드 */
.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.product-header {
  padding: 20px 20px 16px;
}

.delivery-badge {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
}

.product-title {
  font-size: 1.35rem; /* 1.45rem -> 1.35rem */
  font-weight: 800;   /* 900 -> 800 (너무 과하지 않게) */
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--black);
}

.product-meta {
  font-size: 0.95rem; /* 1.05rem -> 0.95rem */
  font-weight: 600;   /* 700 -> 600 */
  color: var(--gray-600); /* var(--black) -> var(--gray-600) */
  line-height: 1.8;
}

.product-meta span {
  display: inline-block;
  margin-right: 12px;
}

/* 영어 품번 강조 스타일 */
.product-id-text {
  font-size: 1.3rem;   /* 품번만 특별히 더 크게 */
  font-weight: 800;    /* 더 두껍게 */
  color: var(--black); /* 아주 진하게 */
  margin-left: 4px;
}

/* 이미지 */
.product-image-container {
  width: 100%;
  height: 380px; /* 고정 높이 지정 */
  background: var(--gray-100);
  overflow: hidden;
  padding: 10px;
}
.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* 별점 */
.star-rating-container {
  padding: 24px 20px 20px;
  text-align: center;
}

.star-label-text {
  font-size: 1rem;   /* 1.1rem -> 1rem */
  font-weight: 700;   /* 800 -> 700 */
  color: var(--gray-600);
  margin-bottom: 14px;
  display: block;
}

.stars {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 6px;
}
.stars input { display: none; }
.stars label {
  font-size: 2.4rem;
  color: var(--gray-200);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}
.stars label:active { transform: scale(1.2); }
.stars input:checked ~ label,
.stars label:hover,
.stars label:hover ~ label {
  color: var(--gold);
}

/* 의견란 */
.q-block {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.q-title {
  font-size: 1rem;   /* 1.1rem -> 1rem */
  font-weight: 700;   /* 800 -> 700 */
  color: var(--black);
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  height: 110px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  color: var(--black);
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
textarea::placeholder { color: var(--gray-400); }
textarea:focus {
  border-color: var(--black);
  background: var(--white);
}

/* ===================== NAV CONTROLS (하단 버튼) ===================== */
.nav-controls {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  z-index: 100;
  max-width: 520px;
  margin: 0 auto;
}

.btn-secondary {
  flex: 1;
  padding: 17px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--black);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;   /* 1.1rem -> 1rem */
  font-weight: 700;   /* 800 -> 700 */
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-secondary:active { transform: scale(0.98); }

.nav-controls .btn-primary {
  flex: 2;
  margin-top: 0;
  padding: 17px;
  border-radius: var(--radius-md);
  font-size: 1rem;   /* 1.1rem -> 1rem */
  font-weight: 700;   /* 800 -> 700 */
  width: auto;
}

/* ===================== PROGRESS INDICATOR ===================== */
.progress-counter {
  text-align: center;
  padding: 10px 16px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.05em;
}

.save-status {
  padding: 0 16px 10px;
  text-align: center;
  color: var(--gray-600);
  font-size: 0.72rem;
  font-weight: 700;
}

.delivery-summary {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.delivery-summary h2 {
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 4px;
}
.delivery-summary p {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-600);
}
.summary-meter {
  min-width: 84px;
  text-align: right;
}
.summary-meter strong {
  display: block;
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
}
.summary-meter span {
  display: block;
  color: var(--gray-400);
  font-size: 0.68rem;
  font-weight: 800;
  margin-top: 4px;
}

.compact-card {
  border: 1px solid var(--gray-100);
}
.compact-card .product-header {
  padding: 16px 18px 12px;
}
.compact-card .product-title {
  font-size: 1.12rem;
}
.compact-card .product-meta {
  font-size: 0.82rem;
  line-height: 1.6;
}
.compact-card .product-id-text {
  font-size: 1rem;
}
.compact-card .product-image-container {
  height: 300px;
}
.compact-card .star-rating-container {
  padding: 18px 18px 14px;
}
.star-label-text em {
  color: var(--gold);
  font-size: 0.75rem;
  font-style: normal;
  margin-left: 4px;
}
.inline-comment {
  box-shadow: none;
  padding: 0 18px 18px;
  margin-bottom: 0;
}
.inline-comment .q-title {
  color: var(--gray-600);
  font-size: 0.78rem;
  margin-bottom: 8px;
}
.q-title span {
  color: var(--gold);
  font-size: 0.72rem;
  margin-left: 5px;
}
.inline-comment textarea {
  height: 74px;
}
.delivery-review {
  margin: 18px 0 72px;
  border: 2px solid var(--gold);
  background: #fffcf5;
}
.delivery-review .q-title {
  color: var(--gold);
}
.delivery-review textarea {
  height: 150px;
  border-color: var(--gold-light);
  background: var(--white);
}
.needs-attention {
  outline: 3px solid rgba(181, 148, 97, 0.38);
  background: #fff9e6;
}

@media (max-width: 420px) {
  .delivery-summary {
    align-items: flex-start;
  }
  .compact-card .product-image-container {
    height: 250px;
  }
  .stars label {
    font-size: 2.15rem;
  }
}

/* ===================== 27FW: 스타일컬러 단위 평가 ===================== */
body { font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }

.gender-jump { display: flex; gap: 8px; margin-bottom: 14px; }
.gender-jump button {
  flex: 1; padding: 11px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: var(--white); font-family: inherit; font-size: 0.85rem; font-weight: 700; color: var(--black); cursor: pointer;
}
.gender-jump button small { color: var(--gray-400); font-weight: 800; margin-left: 4px; }
.gender-jump button.done small { color: var(--gold); }

.gender-title {
  font-size: 0.95rem; font-weight: 800; margin: 22px 4px 10px; display: flex; align-items: baseline; gap: 8px;
  scroll-margin-top: 130px;
}
.gender-title small { font-size: 0.75rem; font-weight: 700; color: var(--gray-400); }

.product-card { scroll-margin-top: 130px; }
.compact-card .product-image-container { height: auto; max-height: 300px; padding: 12px; background: var(--white);
  border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); cursor: zoom-in; display: flex;
  align-items: center; justify-content: center; }
.compact-card .product-image-container img { width: auto; height: auto; max-width: 100%; max-height: 276px; }
.no-image { padding: 26px 0; color: var(--gray-400); font-size: 0.8rem; font-weight: 700; text-align: center;
  border-top: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-100); }

.color-list { padding: 14px 18px 6px; }
.color-list-title { font-size: 0.78rem; font-weight: 700; color: var(--gray-600); margin-bottom: 6px; }
.color-list-title em { color: var(--gold); font-size: 0.72rem; font-style: normal; margin-left: 5px; }
.color-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--gray-100);
}
.color-row:last-child { border-bottom: none; }
.color-thumb { width: 54px; height: 54px; flex-shrink: 0; border-radius: 8px; background: var(--white);
  border: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.color-thumb img { max-width: 100%; max-height: 100%; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.18); }
.color-name { flex: 1; min-width: 0; text-align: left; }
.color-name b { display: block; font-size: 1rem; font-weight: 800; letter-spacing: 0.02em; }
.color-name span { display: block; font-size: 0.72rem; font-weight: 600; color: var(--gray-600); }
.color-row .stars { gap: 2px; flex-shrink: 0; }
.color-row .stars label { font-size: 1.95rem; padding: 2px 1px; }
.color-row.rated { background: #fffcf5; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 2000; display: flex; align-items: center;
  justify-content: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; background: var(--white); border-radius: 8px; }

.done-screen { position: fixed; inset: 0; background: var(--white); z-index: 1500; display: flex; align-items: center;
  justify-content: center; padding: 24px; text-align: center; }
.done-screen h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 12px; }
.done-screen p { color: var(--gray-600); font-size: 0.92rem; line-height: 1.6; }
.done-screen .check { width: 64px; height: 64px; border-radius: 50%; background: var(--black); color: var(--white);
  font-size: 2rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }

.store-chip { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--gray-400); padding: 0 16px 8px; }
#store-etc { margin-top: 10px; text-align: left; letter-spacing: 0; }

@media (max-width: 380px) {
  .color-row .stars label { font-size: 1.7rem; }
  .color-thumb { width: 46px; height: 46px; }
}

/* 차수별 출시 예정일 */
.delivery-summary p.release-date { color: var(--gold); font-size: 0.9rem; font-weight: 800; margin-bottom: 4px; }

/* 매장 변경 · 처음부터 다시 */
.header-links { display: flex; justify-content: center; gap: 18px; padding: 0 16px 10px; }
.header-links button { background: none; border: none; padding: 2px 0; font-family: inherit; font-size: 0.72rem;
  font-weight: 700; color: var(--gray-400); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.header-links button:active { color: var(--black); }
.save-status { padding-bottom: 6px; }

/* 호스팅 배지가 있을 때: 아래 버튼 줄을 배지(높이 64px) 위로 올림 */
.has-host-badge .nav-controls { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.has-host-badge #main-content { padding-bottom: 170px; }

/* 오래된 휴대폰 브라우저(inset 미지원)용 */
#auth-screen, .lightbox, .done-screen { top: 0; right: 0; bottom: 0; left: 0; }

/* 저장 실패 시 안내 상자 */
.backup-box { border: 2px solid var(--error); background: #fff6f6; }
.backup-box .q-title { color: var(--error); }
.backup-box p { font-size: 0.88rem; line-height: 1.6; color: var(--black); margin-bottom: 10px; }
