/* =========================================================================
   tools/social-security/style.css — Social Security calculator
   Theme: Palette C — navy deep (#2D336B)
   Mood: formal, official, secure — สื่อถึง รัฐ ความน่าเชื่อถือ
   ========================================================================= */

body {
  --blue:         #2D336B;   /* primary — navy deep */
  --blue-dark:    #1F2454;   /* hover / pressed */
  --primary-bg:   #ECEEF6;   /* callout bg อ่อน */
  --primary-mid:  #C5CAE2;   /* card lift bg */
  --primary-tint: rgba(45, 51, 107, 0.13);
  --primary-text: #1F2454;   /* darkest navy for text */
  --accent-light: #A9B5DF;   /* lavender border */
  --accent-warm:  #FF8C42;   /* contrast accent (orange) */
}

/* Container */
body .container { max-width: 1400px; padding: 0; }
body .site-header-inner { max-width: 1400px; padding: 0.85rem 1.5rem; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin: 1.25rem 0 0 1.5rem;
  padding: 0.5rem 1rem;
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-pill);
  transition: color 0.15s;
}
.back-link:hover { color: var(--blue); }

/* ============================================================
   Hero Banner — flat (no bg, no padding)
   ============================================================ */
.hero-banner { max-width: 1400px; margin: 1.5rem auto 0; padding: 0 1.5rem; }
.hero-inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: auto;
  position: relative;
}
.hero-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: #fff;
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(45, 51, 107, 0.30);
}
.hero-body { flex: 1; min-width: 0; }
.hero-title {
  font-size: clamp(1.75rem, 4.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--primary-text);
  margin: 0 0 0.5rem;
}
.hero-platform {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  font-size: 0.65em;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.hero-tagline {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-soft);
  margin: 0 0 1.25rem;
}
.hero-tagline strong { color: var(--primary-text); font-weight: 700; }
.hero-stats {
  display: flex;
  gap: 0.55rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.hero-stats li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  background: var(--primary-bg);
  border: none;
  border-radius: 999px;
  line-height: 1.2;
  transition: transform 0.15s, background 0.15s;
}
.hero-stats li:hover { transform: translateY(-2px); background: var(--primary-mid); }
.hero-stat-num {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}
.hero-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-soft);
  font-weight: 500;
}
@media (max-width: 768px) {
  .hero-banner { padding: 0 1rem; }
  .hero-inner { flex-direction: column; align-items: flex-start; padding: 0; gap: 1rem; min-height: 0; }
  .hero-icon { width: 56px; height: 56px; border-radius: 14px; }
  .hero-icon svg { width: 32px; height: 32px; }
  .hero-stats { gap: 0.4rem; }
}

/* ============ Layout — 2 cols ============ */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 1.5rem;
}
.calc-form, .calc-result { padding: 2rem 2rem 3rem; min-width: 0; }
.form-card, .result-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 1.75rem 1.85rem;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 6px 18px rgba(15,23,42,0.04);
}
@media (max-width: 768px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-form, .calc-result { padding: 1.25rem 1rem 1.5rem; }
  .calc-form { padding-bottom: 0.5rem; }
}
@media (max-width: 480px) {
  .form-card, .result-card { padding: 1.25rem 1.1rem; border-radius: 12px; }
}

/* ============ Form ============ */
.page-title {
  font-size: clamp(1.4rem, 3.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.page-subtitle { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.75rem; }

.field { margin-bottom: 1.75rem; }
.field-label {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.65rem;
  letter-spacing: -0.01em;
}
.lbl-hint {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.4rem;
  letter-spacing: 0;
}
.field-input {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 0.45rem;
  transition: border-color 0.15s;
}
.field-input:focus-within { border-color: var(--blue); }
.field-prefix { font-size: 1.5rem; font-weight: 500; color: var(--muted); line-height: 1; }
.field-input input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 1.6rem; font-weight: 500; font-family: inherit; color: var(--text);
  padding: 0; width: 100%; letter-spacing: -0.01em; -moz-appearance: textfield;
}
.field-input input::-webkit-outer-spin-button,
.field-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-input input::placeholder { color: #CBD5E1; font-weight: 400; }
.error-msg { color: #DC2626; font-size: 0.85rem; margin-top: 0.55rem; font-weight: 500; display: none; }
.error-msg.show { display: block; }

.hint-text { font-size: 0.85rem; color: var(--muted); line-height: 1.55; margin-top: 0.55rem; }
.hint-text strong { color: var(--text-soft); font-weight: 600; }

/* Info pill — บอกเพดาน/อัตราที่ตายตัว ไม่ต้องกรอก */
.info-pill {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-top: 0.5rem;
  background: var(--primary-bg);
  border: 1px solid var(--accent-light);
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.info-pill-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.info-pill strong {
  color: var(--primary-text);
  font-weight: 700;
}

/* Quick presets */
.quick-presets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.quick-presets button {
  padding: 0.4rem 0.85rem; background: #fff; border: 1px solid var(--border);
  border-radius: 999px; font-family: inherit; font-size: 0.8rem; font-weight: 500;
  color: var(--text-soft); cursor: pointer; transition: all 0.15s;
}
.quick-presets button:hover { border-color: var(--accent-light); color: var(--blue); }
.quick-presets button.is-active {
  background: var(--primary-bg); border-color: var(--blue); color: var(--blue); font-weight: 600;
}

/* Primary button */
.btn {
  display: block; width: 100%; padding: 1rem;
  background: var(--blue); color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer;
  margin-top: 1.5rem; transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(45, 51, 107, 0.32);
}
.btn:hover {
  background: var(--blue-dark);
  box-shadow: 0 6px 22px rgba(45, 51, 107, 0.42);
  transform: translateY(-1px);
}

/* ============ Result ============ */
.result-empty { text-align: center; padding: 3.5rem 1.5rem; color: var(--muted); }
.result-empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.55; }
.result-content { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Big Number Cards (2 ใบเคียงกัน) */
.summary-cards {
  display: grid; grid-template-columns: 1fr; gap: 0.85rem; margin-bottom: 1rem;
}
.summary-cards-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .summary-cards-2 { grid-template-columns: 1fr; } }
.summary-card {
  padding: 1.6rem 1.25rem;
  border-radius: 16px;
  border: 1px solid;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.summary-card-net {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.5) 0%, transparent 60%),
    linear-gradient(140deg, var(--primary-bg) 0%, var(--primary-mid) 100%);
  border-color: var(--accent-light);
}
.summary-card-net::before {
  content: ""; position: absolute; bottom: -20px; right: -20px;
  width: 140px; height: 80px;
  background-image: radial-gradient(circle, var(--accent-light) 1px, transparent 1.5px);
  background-size: 12px 12px; opacity: 0.55; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at right bottom, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at right bottom, black 30%, transparent 75%);
}
/* Card 2 — นายจ้างจ่าย — สีเหลือง/อ่อนต่างจาก primary card */
.summary-card-employer {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.5) 0%, transparent 60%),
    linear-gradient(140deg, #FFF8E6 0%, #FFEFC9 100%);
  border-color: #F4D738;
}
.summary-card-employer .summary-card-label,
.summary-card-employer .summary-card-note { color: #6B5400; }
.summary-card-employer .summary-card-value { color: #946D00; }

.summary-card-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 0.45rem;
  opacity: 0.85;
}
.summary-card-value {
  font-size: clamp(2rem, 5.5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--primary-text);
}
.summary-card-note {
  font-size: 0.82rem;
  color: var(--primary-text);
  opacity: 0.75;
  font-weight: 500;
}

/* Heading "รายละเอียด" ใน result-card */
.result-detail-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-text);
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
  padding: 0.5rem 0.85rem;
  background: var(--primary-bg);
  border-radius: 999px;
  border: 1px solid var(--accent-light);
}
.result-detail-title svg { stroke: currentColor; opacity: 0.85; }

/* Breakdown */
.break-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.75rem 0.25rem; font-size: 0.95rem; line-height: 1.5;
}
.break-row + .break-row { border-top: 1px dashed #E2E8F0; }
.break-label {
  color: var(--text-soft);
  display: inline-flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
}
.break-formula { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.break-value { font-weight: 600; color: var(--text); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.break-deduct { color: #DC2626; font-weight: 600; }
.break-row-subtotal {
  margin-top: 0.35rem;
  padding: 0.85rem 0.85rem !important;
  background: var(--primary-bg);
  border-radius: 8px;
  border-top: none !important;
}
.break-row-subtotal + .break-row { border-top: 1px dashed #E2E8F0; margin-top: 0.35rem; }
.break-row-subtotal .break-label { font-weight: 600; color: var(--primary-text); }
.break-row-subtotal .break-value { color: var(--primary-text); }
.break-row-final {
  margin-top: 0.5rem; padding-top: 1.1rem !important;
  border-top: 2px solid var(--text) !important;
}
.break-row-final .break-label { font-size: 1rem; font-weight: 700; color: var(--text); }
.break-final { font-size: 1.2rem; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.rate-badge {
  background: var(--primary-tint); color: var(--blue);
  padding: 0.12rem 0.55rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
}

/* Summary callout */
.summary-callout {
  display: flex; gap: 0.85rem; align-items: flex-start;
  margin-top: 1.5rem; padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, var(--primary-bg) 0%, var(--primary-mid) 100%);
  border: 1px solid var(--accent-light); border-radius: 14px;
}
.summary-icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.4; }
.summary-text { color: var(--primary-text); font-size: 0.95rem; line-height: 1.7; margin: 0; font-variant-numeric: tabular-nums; }
.summary-text strong { font-weight: 700; color: var(--primary-text); white-space: nowrap; }

/* Disclaimer callout */
.disclaimer-callout {
  display: flex; gap: 0.85rem; align-items: flex-start;
  margin-top: 1rem; padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, #FFF8E6 0%, #FFEFC9 100%);
  border: 1px solid #F4D738;
  border-radius: 14px;
}
.disclaimer-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1.3; }
.disclaimer-body { color: #6B5400; font-size: 0.9rem; line-height: 1.65; }
.disclaimer-body strong { color: #4A3900; }
.disclaimer-body ul { margin: 0.55rem 0 0.4rem 0; padding-left: 1.25rem; }
.disclaimer-body ul li { margin-bottom: 0.2rem; }
.disclaimer-body ul li strong { color: #4A3900; font-weight: 700; }

/* Result actions */
.result-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  margin-top: 1rem; flex-wrap: wrap;
}
.action-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.6rem 1rem; background: #fff; color: var(--text-soft);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.15s;
}
.action-btn:hover { background: var(--primary-bg); color: var(--blue); border-color: var(--accent-light); }
.action-btn.is-success { background: var(--blue); color: #fff; border-color: var(--blue); }
.action-btn svg { stroke: currentColor; }

/* ============ Info + FAQ — 2 cols ============ */
.info-grid {
  max-width: 1400px; margin: 4rem auto 5rem;
  padding: 0 2rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start;
}
@media (max-width: 768px) {
  .info-grid { grid-template-columns: 1fr; gap: 3rem; padding: 0 1rem; margin: 3rem auto 4rem; }
}
.info-accordion { margin: 0; padding: 0; max-width: none; }
.info-accordion-title {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.015em;
  color: var(--text); margin: 0 0 0.5rem;
}
.info-accordion-faq .faq-grid { display: block; }

.info-acc {
  background: transparent; border: none;
  border-bottom: 1px solid var(--border-soft); border-radius: 0;
  margin: 0; padding: 0;
}
.info-acc:first-of-type { border-top: 1px solid var(--border-soft); }
.info-acc summary {
  padding: 1.25rem 0.25rem; cursor: pointer; list-style: none;
  font-size: 0.95rem; font-weight: 400; color: var(--text-soft);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.25rem; user-select: none; transition: color 0.15s;
}
.info-acc summary::-webkit-details-marker { display: none; }
.info-acc summary::after {
  content: ""; width: 9px; height: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); margin-bottom: 4px;
  transition: transform 0.25s, border-color 0.15s; flex-shrink: 0; opacity: 0.7;
}
.info-acc[open] summary::after { transform: rotate(225deg); margin-bottom: -4px; border-color: var(--blue); opacity: 1; }
.info-acc summary:hover { color: var(--text); }
.info-acc[open] summary { font-weight: 500; color: var(--text); }
.info-acc-body {
  padding: 0 0.25rem 1.4rem; color: var(--text-soft);
  font-size: 0.95rem; line-height: 1.85;
}
.info-acc-body p { margin-bottom: 0.8rem; }
.info-acc-body p:last-child { margin-bottom: 0; }
.info-acc-body strong { color: var(--text); font-weight: 600; }
.info-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  padding: 0.55rem 0.85rem;
  background: var(--primary-bg);
  border-left: 3px solid var(--accent-light);
  border-radius: 6px;
  margin-top: 0.5rem !important;
}
.info-note strong { color: var(--text-soft); font-style: normal; }

.rate-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.rate-list li {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.65rem 0.85rem; background: #F8FAFC; border-radius: 8px;
  font-size: 0.9rem; color: var(--text-soft);
}
.rate-pct {
  flex-shrink: 0; min-width: 5rem; text-align: center;
  background: var(--primary-tint); color: var(--blue);
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
}

.formula { background: #F8FAFC; border-radius: 10px; padding: 0.95rem 1.15rem; }
.formula-row { padding: 0.45rem 0; font-size: 0.9rem; color: var(--text-soft); line-height: 1.7; }
.formula-row + .formula-row { border-top: 1px dashed var(--border); }

@media (max-width: 480px) {
  .field { margin-bottom: 1.5rem; }
  .info-grid { padding: 0 1rem; }
  .info-acc summary { padding: 1.1rem 0.25rem; font-size: 0.95rem; }
}
