@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --border: #dbe3ee;
  --success: #087a55;
  --danger: #a33c35;
  --danger-bg: #fff5f4;
  --shadow: 0 10px 30px rgba(30, 64, 175, 0.07);
  --radius: 16px;
  --section-space: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--card);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
}

button,
input,
select,
textarea {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Noto Sans KR", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: -0.035em;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.65rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

.container {
  width: min(1040px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(219, 227, 238, 0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.header-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--primary);
  font-size: 1.12rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  padding: 9px 12px;
  border-radius: 9px;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 700;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font-size: 1.25rem;
}

.hero,
.tool-first-hero {
  padding: 58px 0 28px;
  background:
    radial-gradient(circle at 80% 5%, rgba(37, 99, 235, 0.1), transparent 26%),
    linear-gradient(180deg, #f7faff 0%, #fff 100%);
}

.tool-intro {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.tool-intro h1 {
  margin-bottom: 14px;
}

.tool-intro > p:last-child,
.hero-copy {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 1.06rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  justify-content: center;
}

.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

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

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  border-color: var(--border);
  color: #42506a;
  background: #fff;
}

.section {
  padding: var(--section-space) 0;
}

.section-soft {
  background: var(--bg);
}

.section-heading {
  max-width: 700px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin-bottom: 9px;
}

.section-heading p,
.muted {
  color: var(--muted);
}

.calculator-card,
.tool-card,
.info-card,
.directory-group,
.result-card,
.guide-card,
.related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.calculator-card {
  padding: 28px;
}

.home-calculator {
  max-width: 720px;
  margin: 0 auto;
}

.tool-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.tool-card-heading h2,
.tool-card-heading p {
  margin-bottom: 6px;
}

.inline-tool-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.inline-tool-form .form-group {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.91rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.input-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.error-message {
  display: none;
  margin: 15px 0 0;
  padding: 11px 13px;
  border: 1px solid #f0c9c5;
  border-radius: 9px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 0.9rem;
  font-weight: 650;
}

.error-message:not(:empty) {
  display: block;
}

.result-card {
  display: none;
  margin-top: 20px;
  padding: 22px;
  border-color: #bdd3fb;
  background: #f8fbff;
  box-shadow: none;
}

.result-card.show {
  display: block;
}

.result-card h3 {
  margin-bottom: 4px;
  color: var(--primary-dark);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.result-item {
  padding: 14px;
  border: 1px solid #e5edf9;
  border-radius: 11px;
  background: #fff;
}

.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.result-item strong {
  display: block;
  margin-top: 3px;
  font-size: 1.18rem;
}

.formula-box {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 9px;
  color: #425575;
  background: #eaf2ff;
  font-size: 0.88rem;
}

.mode-fields {
  display: none;
}

.mode-fields.active {
  display: block;
}

.tool-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  box-shadow: 0 7px 22px rgba(30, 64, 175, 0.055);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #b5cbf4;
}

.tool-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 12px;
  background: var(--primary-soft);
  font-size: 1.25rem;
}

.tool-card h3 {
  margin-bottom: 7px;
}

.tool-card p {
  flex: 1;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.91rem;
}

.text-link {
  color: var(--primary-dark);
  font-size: 0.91rem;
  font-weight: 750;
}

.content-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.info-card,
.guide-card {
  padding: 23px;
  box-shadow: none;
}

.info-card p:last-child,
.guide-card p:last-child {
  margin-bottom: 0;
}

.page-hero {
  padding: 50px 0 28px;
  background: linear-gradient(180deg, #f7faff, #fff);
  text-align: center;
}

.page-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.page-hero p {
  max-width: 680px;
  margin: 0 auto;
  color: var(--muted);
}

.calculator-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.side-note {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.side-note h2 {
  font-size: 1.18rem;
}

.side-note ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.tool-guide-grid {
  max-width: 900px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 34px auto 0;
}

.guide-card h2,
.guide-card h3 {
  font-size: 1.1rem;
}

.guide-number {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.article-content {
  max-width: 840px;
  margin: 0 auto;
}

.article-content h2 {
  margin-top: 38px;
  margin-bottom: 12px;
  font-size: 1.52rem;
}

.article-content h3 {
  margin-top: 24px;
}

.article-content p,
.article-content li {
  color: #4c596c;
}

.article-content li + li {
  margin-top: 6px;
}

.notice {
  margin: 22px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--primary);
  border-radius: 0 10px 10px 0;
  color: #405673;
  background: var(--primary-soft);
}

.tool-followup-section {
  max-width: 840px;
  margin: 42px auto 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.tool-followup-section .section-heading {
  margin-bottom: 12px;
}

.related-tools,
.next-tools {
  max-width: 900px;
  margin: 42px auto 0;
  padding: 28px;
  border: 1px solid #c9dcff;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.related-tools-heading,
.next-tools > div:first-child {
  margin-bottom: 18px;
}

.related-tools h2,
.next-tools h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.related-tools p,
.next-tools p {
  margin-bottom: 0;
  color: var(--muted);
}

.related-tool-grid,
.next-tool-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.related-card,
.next-tool-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  box-shadow: none;
  font-weight: 750;
}

.related-card:hover,
.next-tool-links a:hover {
  color: var(--primary-dark);
  border-color: #a8c4f7;
}

.faq-list {
  max-width: 840px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 750;
}

.faq-question::after {
  content: "+";
  color: var(--primary);
  font-size: 1.35rem;
}

.faq-question[aria-expanded="true"]::after {
  content: "−";
}

.faq-answer {
  display: none;
  padding: 0 34px 18px 0;
  color: var(--muted);
}

.faq-answer.open {
  display: block;
}

.directory-section {
  padding: 42px 0;
  background: #edf4ff;
}

.directory-title {
  margin-bottom: 15px;
  color: #123b7a;
  font-size: 1.28rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.directory-group {
  min-height: 190px;
  padding: 15px 13px;
  border-color: #aac7f4;
  border-radius: 12px;
  box-shadow: none;
}

.directory-group h3 {
  margin-bottom: 8px;
  color: #10366f;
  font-size: 0.92rem;
}

.directory-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.directory-list a {
  display: block;
  padding: 4px 0;
  color: #154a9f;
  font-size: 0.78rem;
  line-height: 1.5;
}

.directory-list a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px;
  border: 1px solid #c9dcff;
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.privacy-strip h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.privacy-strip p {
  margin-bottom: 0;
  color: #4b5f7d;
}

.ad-placeholder {
  min-height: 105px;
  display: grid;
  place-items: center;
  margin: 36px 0;
  border: 1px dashed #b7c1cf;
  border-radius: 12px;
  color: #8a95a5;
  background: #fafbfc;
  font-size: 0.86rem;
}

.site-footer {
  padding: 48px 0 24px;
  color: #cbd5e1;
  background: #172033;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
}

.site-footer h2 {
  font-size: 1.18rem;
}

.site-footer h3 {
  font-size: 0.98rem;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #344056;
  color: #94a3b8;
  font-size: 0.83rem;
}

@media (max-width: 900px) {
  .tool-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-guide-grid,
  .related-tool-grid,
  .next-tool-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  :root {
    --section-space: 48px;
  }

  .container {
    width: min(100% - 28px, 1040px);
  }

  .header-inner {
    min-height: 62px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .main-nav {
    position: absolute;
    top: 62px;
    right: 14px;
    left: 14px;
    display: none;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: grid;
  }

  .main-nav a {
    padding: 10px 12px;
  }

  .hero,
  .tool-first-hero {
    padding: 42px 0 20px;
  }

  .page-hero {
    padding: 40px 0 23px;
  }

  .tool-card-heading,
  .privacy-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-tool-form,
  .form-grid,
  .result-grid,
  .tool-grid,
  .card-grid,
  .content-grid,
  .info-grid,
  .tool-guide-grid,
  .related-tool-grid,
  .next-tool-links,
  .directory-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .calculator-card,
  .tool-followup-section,
  .related-tools,
  .next-tools {
    padding: 21px;
  }

  .button-row .btn {
    flex: 1;
  }

  .tool-card {
    min-height: auto;
  }

  .directory-group {
    min-height: auto;
  }

  .privacy-strip {
    padding: 23px;
  }
}
