/* ==========================
   쪼아 더치페이 계산기 스타일
   파일명: dutch.css
   ========================== */

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --blue-soft: #eef4ff;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #f5f7fb 0%, #eef3fb 100%);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  line-height: 1.5;
}

body { min-height: 100vh; }

.zzoa-wrap {
  width: 100%;
  padding: 20px 16px 48px;
}

.dutch-page {
  max-width: 1100px;
  margin: 0 auto;
}

/* 공통 패널 */
.panel,
.hero-card {
  background: var(--card);
  border: 1px solid #dde5f1;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}

.hero-card::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
}

.hero-inner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 22px;
}

.hero-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eaf2ff, #eefbf6);
  display: grid;
  place-items: center;
  font-size: 28px;
  flex-shrink: 0;
  border: 1px solid #dbe7fb;
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  line-height: 1.2;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-text p {
  margin: 0;
  color: #475569;
  font-size: 1rem;
}

.hero-text .highlight {
  color: #2563eb;
  font-weight: 700;
}

/* 패널 헤더/바디 */
.panel {
  margin-bottom: 20px;
  overflow: hidden;
}

.panel-header {
  background: linear-gradient(180deg, #f3f7ff 0%, #eef4ff 100%);
  border-bottom: 1px solid #e3eaf6;
  padding: 20px 20px 16px;
}

.panel-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  color: #1e3a8a;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
}

.panel-body {
  padding: 20px;
}

/* 폼 */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 700;
  color: #374151;
}

.field small {
  color: var(--muted);
  font-size: 0.87rem;
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  height: 54px;
  border: 1px solid #d6deea;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 1.05rem;
  color: #1f2937;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus,
.field select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

/* segmented */
.segmented {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seg-item {
  cursor: pointer;
  position: relative;
}

.seg-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 106px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #d7dfeb;
  background: #fff;
  color: #475569;
  font-weight: 700;
  padding: 0 12px;
  transition: all .15s ease;
}

.seg-item input:checked + span {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.tip-input-wrap { position: relative; }

.tip-input-wrap input {
  padding-right: 62px !important;
}

.unit-badge {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #dbe1ff;
  padding: 4px 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

/* 토글카드 */
.toggle-card {
  border: 1px solid #e3eaf6;
  background: #fafcff;
  border-radius: 12px;
  padding: 12px;
}

.switch-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-slider {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background .18s ease;
  flex-shrink: 0;
}

.switch-slider::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .18s ease;
}

.switch-row input:checked + .switch-slider {
  background: #60a5fa;
}

.switch-row input:checked + .switch-slider::after {
  transform: translateX(20px);
}

.switch-label {
  font-weight: 600;
  color: #374151;
  line-height: 1.35;
}

/* 버튼 */
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  padding-top: 8px;
}

.btn {
  height: 50px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.btn-secondary {
  color: #334155;
  background: #f8fafc;
  border-color: #dbe3ef;
}

.btn-outline {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.btn:hover { opacity: .95; }

/* ✅ 공유 버튼 아래 인라인 메세지 박스 */
.share-message-box {
  margin-top: 10px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff, #eef4ff);
  color: #1e3a8a;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.08);
  animation: shareMessageFadeIn 0.18s ease;
}

.share-message-box[hidden] {
  display: none !important;
}

.share-message-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.share-message-box p {
  margin: 0;
  line-height: 1.4;
  font-size: 0.93rem;
  font-weight: 600;
  color: #1e3a8a;
}

.share-message-close {
  border: none;
  background: transparent;
  color: #1e3a8a;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: .8;
  padding: 0;
}

.share-message-close:hover {
  opacity: 1;
}

@keyframes shareMessageFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 에러 */
.error-box {
  margin-top: 12px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
}

/* 결과 카드 */
.result-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.result-card {
  border-radius: 16px;
  padding: 16px 14px;
  border: 2px solid transparent;
  text-align: center;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}

.result-card .card-emoji {
  font-size: 1.9rem;
  margin-bottom: 6px;
}

.result-card h3 {
  margin: 4px 0 8px;
  font-size: 1rem;
  color: #334155;
}

.result-card .value {
  margin: 0;
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.2;
}

.result-card small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-weight: 600;
}

.card-green {
  background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
  border-color: #34d399;
}
.card-green .value { color: #059669; }

.card-blue {
  background: linear-gradient(180deg, #eff6ff, #eef4ff);
  border-color: #60a5fa;
}
.card-blue .value { color: #2563eb; }

.card-amber {
  background: linear-gradient(180deg, #fffbeb, #fff7d6);
  border-color: #fbbf24;
}
.card-amber .value { color: #d97706; }

/* 상세 계산 박스 */
.detail-box {
  margin-top: 6px;
  border: 1px solid #dfe7f3;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.detail-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: #1d4ed8;
}

.detail-list {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #eef2f7;
  padding: 8px 0;
  color: #334155;
}

.detail-row:last-child { border-bottom: none; }

.detail-row strong {
  color: #0f172a;
  font-size: 1rem;
}

.total-row {
  margin-top: 4px;
  border-top: 2px solid #e2e8f0;
  padding-top: 12px;
  font-weight: 800;
}
.total-row strong {
  color: #111827;
  font-size: 1.1rem;
}

.accent-row {
  margin-top: 4px;
  background: linear-gradient(135deg, #10b981, #0ea5a6);
  border-radius: 12px;
  border: none;
  padding: 12px 14px;
  color: #fff;
  font-weight: 800;
}
.accent-row strong {
  color: #fff;
  font-size: 1.15rem;
}

/* 중요 안내 배너 */
.notice-banner {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4, #ecfdf5);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notice-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #047857;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.notice-text {
  color: #065f46;
  font-size: 0.97rem;
}

.notice-text strong {
  color: #065f46;
  margin-right: 6px;
}

/* 가이드 카드 그리드 */
.guide-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.guide-card {
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}

.guide-card h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  font-size: 1.08rem;
}

.guide-content {
  padding: 14px 16px;
  color: #475569;
}

.guide-content p { margin: 0 0 8px; }
.guide-content p:last-child { margin-bottom: 0; }

.guide-content hr {
  border: 0;
  height: 1px;
  background: #edf2f7;
  margin: 12px 0;
}

.guide-payment ol {
  margin: 0;
  padding-left: 18px;
}
.guide-payment li {
  margin-bottom: 12px;
}
.guide-payment li:last-child {
  margin-bottom: 0;
}

.guide-saving ul {
  margin: 0;
  padding-left: 18px;
}
.guide-saving li {
  margin-bottom: 10px;
}
.guide-saving li:last-child {
  margin-bottom: 0;
}

.guide-analysis { border-color: #bbf7d0; }
.guide-analysis h3 {
  background: #f0fdf4;
  color: #065f46;
}

.guide-payment { border-color: #bfdbfe; }
.guide-payment h3 {
  background: #eff6ff;
  color: #1d4ed8;
}

.guide-saving { border-color: #fde68a; }
.guide-saving h3 {
  background: #fffbeb;
  color: #b45309;
}

.guide-recommend { border-color: #c7d2fe; }
.guide-recommend h3 {
  background: #eef2ff;
  color: #3730a3;
}

.recommend-list {
  display: grid;
  gap: 10px;
}

.recommend-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  background: #f8fafc;
  border: 1px solid #e7edf5;
  border-radius: 12px;
  padding: 10px 12px;
}

.recommend-item span {
  font-size: 1.25rem;
  line-height: 1.2;
}

.recommend-item p {
  margin: 0;
  line-height: 1.45;
  color: #334155;
}

/* 반응형 */
@media (max-width: 980px) {
  .result-cards { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero-inner {
    padding: 18px 16px;
    gap: 12px;
  }

  .hero-icon {
    width: 52px;
    height: 52px;
    font-size: 24px;
    border-radius: 14px;
  }

  .hero-text h1 {
    font-size: 1.55rem;
    gap: 8px;
  }

  .panel-header,
  .panel-body {
    padding: 16px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 14px;
  }

  .field input[type="text"],
  .field input[type="number"],
  .field select {
    height: 50px;
    font-size: 1rem;
  }

  .action-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .share-message-box {
    grid-template-columns: auto 1fr auto;
    align-items: start;
  }

  .share-message-box p {
    font-size: 0.9rem;
  }

  .result-card .value {
    font-size: 1.7rem;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
  }

  .detail-row strong {
    justify-self: start;
  }

  .switch-row {
    grid-template-columns: auto auto 1fr;
    align-items: start;
  }
}