/* ===== Variables ===== */
:root {
  --color-navy: #0D2B4E;
  --color-blue: #1A6FBF;
  --color-sky: #E8F4FD;
  --color-white: #FFFFFF;
  --color-gray-light: #F5F7FA;
  --color-gray-border: #E2E8F0;
  --color-text: #1A1A2E;
  --color-text-sub: #5A6A7A;
  --color-gold: #C9A84C;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(13,43,78,0.08);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Spoqa Han Sans Neo', 'Noto Sans KR', sans-serif;
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-gray-light);
  padding-bottom: 40px;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ===== Header ===== */
.header {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  max-width: 480px;
  margin: 0 auto;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}
.brand-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--color-white);
}
.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.2px;
  font-weight: 400;
}
.partner-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(201,168,76,0.12);
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 8px;
  padding: 6px 10px;
  flex-shrink: 0;
}
.partner-icon {
  color: var(--color-gold);
  font-size: 14px;
  line-height: 1;
}
.partner-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-gold);
  line-height: 1.4;
  letter-spacing: -0.1px;
}

/* ===== Main ===== */
.main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Hero ===== */
.hero {
  padding: 20px 0 16px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-blue);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  background: rgba(26,111,191,0.08);
  padding: 3px 10px;
  border-radius: 999px;
}
.hero-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.35;
  margin-bottom: 8px;
  letter-spacing: -0.8px;
}
.hero-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.6;
  opacity: 0.7;
}

/* ===== Section ===== */
.section {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  margin-bottom: 16px;
}

/* ===== Steps ===== */
.step { margin-bottom: 28px; }
.step:last-of-type { margin-bottom: 0; }
.step-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.optional {
  font-size: 13px;
  color: var(--color-text-sub);
  font-weight: 400;
}

/* ===== Chips ===== */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 공간 종류: 3열 그리드 */
#spaceTypeGroup {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
/* 추가 조건: 1줄 균등 배분 */
#conditionGroup {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}
#conditionGroup .chip {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
}
.chip {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--color-gray-border);
  background: var(--color-white);
  color: var(--color-text-sub);
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
}
.chip.active {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
  font-weight: 700;
}
.chip:hover:not(.active) {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

/* ===== Unit Tab ===== */
.unit-tab-group {
  display: flex;
  margin-bottom: 12px;
  border: 1.5px solid var(--color-gray-border);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}
.unit-tab {
  padding: 7px 22px;
  font-size: 14px;
  color: var(--color-text-sub);
  background: var(--color-white);
  border: none;
  transition: all 0.15s;
}
.unit-tab.active {
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 700;
}

/* ===== Area Input ===== */
.area-inputs {
  display: flex;
  align-items: center;
}
.area-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--color-gray-border);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--color-white);
  flex: 1;
}
.area-input-wrap:focus-within { border-color: var(--color-blue); }
.area-input {
  border: none;
  outline: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-navy);
  width: 100%;
  background: transparent;
}
.area-input::placeholder { font-weight: 400; color: #C0C8D4; }
.area-unit {
  font-size: 15px;
  color: var(--color-text-sub);
  white-space: nowrap;
}

/* ===== Textarea ===== */
.textarea {
  width: 100%;
  min-height: 88px;
  border: 1.5px solid var(--color-gray-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--color-text);
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.textarea:focus { border-color: var(--color-blue); }
.textarea::placeholder { color: #C0C8D4; }

/* ===== Calc Button ===== */
.btn-calc {
  display: block;
  width: 100%;
  margin-top: 28px;
  padding: 17px;
  background: var(--color-navy);
  color: var(--color-white);
  font-size: 17px;
  font-weight: 700;
  border-radius: var(--radius);
  letter-spacing: -0.2px;
  transition: background 0.15s, transform 0.1s;
}
.btn-calc:hover { background: #163C64; }
.btn-calc:active { transform: scale(0.985); }
.btn-calc:disabled { background: #B0BAC6; cursor: not-allowed; }

/* ===== Result Section ===== */
.result-section {
  background: var(--color-sky);
  animation: fadeIn 0.45s ease;
}
.result-card {
  background: var(--color-navy);
  border-radius: var(--radius);
  padding: 28px 20px;
  color: var(--color-white);
  margin-bottom: 16px;
}
.result-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 14px 0;
}
.result-input-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.result-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.15);
}
.result-input-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.5px;
}
.result-recommend-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  gap: 6px;
}
.result-label {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.3px;
}
.result-pyung {
  font-size: 52px;
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: -1.5px;
  line-height: 1;
}
.result-reason {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  text-align: center;
}

/* ===== Multi Unit Banner ===== */
.multi-unit-banner {
  background: rgba(201,168,76,0.1);
  border: 1.5px solid rgba(201,168,76,0.4);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.7;
  text-align: center;
}
.multi-unit-banner strong {
  color: var(--color-navy);
  font-weight: 700;
}

/* ===== Product Cards ===== */
.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}
.product-img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  object-position: center;
  display: block;
  background: #ececec;
  padding: 16px;
  box-sizing: border-box;
}
.product-card .product-name,
.product-card .product-pyung-range,
.product-card .product-desc {
  padding-left: 20px;
  padding-right: 20px;
  text-align: center;
}
.product-card .product-name { padding-top: 16px; }
.product-card .product-link {
  display: block;
  margin: 4px 20px 20px;
  padding: 10px 20px;
  text-align: center;
}
.product-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 4px;
}
.product-name--truncated {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.product-name--truncated.product-name--expanded {
  white-space: normal;
  overflow: visible;
}
.product-name-arrow {
  font-size: 12px;
  color: var(--color-text-sub);
  vertical-align: middle;
}
.product-pyung-range {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-bottom: 6px;
}
.product-desc {
  font-size: 14px;
  color: var(--color-text-sub);
  line-height: 1.5;
  margin-bottom: 12px;
}
.product-link {
  background: var(--color-blue);
  color: var(--color-white);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s;
}
.product-link:hover { background: #155C9E; }

/* ===== Call Block ===== */
.call-block {
  background: var(--color-white);
  border-radius: var(--radius);
  border: 1.5px solid var(--color-gray-border);
  padding: 20px;
  margin-bottom: 12px;
}
.call-notice {
  font-size: 14px;
  color: var(--color-text-sub);
  line-height: 1.7;
  margin-bottom: 16px;
  text-align: center;
}
.btn-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 16px;
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius);
  text-align: center;
  transition: background 0.15s;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}
.btn-call:hover { background: #163C64; }
.btn-call-num {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-gold);
}
.trust-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trust-list li {
  font-size: 13px;
  color: var(--color-text-sub);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}
.trust-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 7px;
  border-left: 1.8px solid var(--color-blue);
  border-bottom: 1.8px solid var(--color-blue);
  transform: rotate(-45deg);
}

/* ===== Store Button ===== */
.btn-store {
  display: block;
  width: 100%;
  padding: 15px;
  background: transparent;
  color: var(--color-navy);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius);
  text-align: center;
  border: 1.5px solid var(--color-navy);
  margin-top: 4px;
  transition: background 0.15s, color 0.15s;
}
.btn-store:hover {
  background: var(--color-navy);
  color: var(--color-white);
}

/* ===== Floating Phone Button ===== */
.fab-phone {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 52px;
  height: 52px;
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(13,43,78,0.3);
  z-index: 100;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.fab-phone:hover {
  background: #163C64;
  transform: scale(1.07);
  box-shadow: 0 6px 20px rgba(13,43,78,0.4);
}
.fab-phone.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(13,43,78,0.3), 0 0 0 0 rgba(13,43,78,0.4); }
  50% { box-shadow: 0 4px 16px rgba(13,43,78,0.3), 0 0 0 10px rgba(13,43,78,0); }
}

/* ===== Loading ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,43,78,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,0.25);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin-bottom: 14px;
}
.loading-text {
  color: var(--color-white);
  font-size: 15px;
  font-weight: 500;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Utilities ===== */
.hidden { display: none !important; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Desktop ===== */
@media (min-width: 520px) {
  .main { padding: 0 24px; }
  .hero-title { font-size: 28px; }
  .cta-phone { font-size: 17px; }
}
