/* HanCalc — Premium Calculator UI */
:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --secondary: #10B981;
  --secondary-dark: #059669;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text-dark: #0F172A;
  --text-light: #64748B;
  --border: #E2E8F0;
  --gradient: linear-gradient(135deg, #2563EB 0%, #10B981 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 14px rgba(15, 23, 42, .08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none
}

a:hover {
  color: var(--primary-dark)
}

img {
  max-width: 100%;
  display: block
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text-dark);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
}

.brand-name {
  letter-spacing: -.02em
}

.brand-accent {
  color: var(--secondary)
}

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

.main-nav a {
  color: var(--text-light);
  font-weight: 500;
  font-size: 15px;
  transition: color .2s
}

.main-nav a:hover {
  color: var(--text-dark)
}

.nav-cta {
  color: #fff !important
}

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, .25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  color: #fff
}

.btn-large {
  padding: 16px 32px;
  font-size: 16px;
  width: 100%
}

.btn-secondary {
  background: #fff;
  color: var(--text-dark);
  border: 1px solid var(--border)
}

.btn-secondary:hover {
  background: var(--bg)
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px
}

/* HERO */
.hero {
  padding: 88px 0 64px;
  text-align: center;
  background:
    radial-gradient(ellipse at top, rgba(37, 99, 235, .08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(16, 185, 129, .08), transparent 60%);
}

.hero h1 {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
}

.hero p {
  font-size: 19px;
  color: var(--text-light);
  max-width: 680px;
  margin: 0 auto 36px
}

.search-wrap {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 16px;
  color: var(--text-dark);
  font-family: inherit;
}

.search-wrap input::placeholder {
  color: #94a3b8
}

.search-wrap .btn {
  padding: 14px 22px
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap
}

.hero-stats div {
  text-align: center
}

.hero-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark)
}

.hero-stats span {
  color: var(--text-light);
  font-size: 14px
}

/* SECTIONS */
section.section {
  padding: 64px 0
}

.section-head {
  margin-bottom: 40px;
  text-align: center
}

.section-head h2 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 10px
}

.section-head p {
  color: var(--text-light);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto
}

/* CARD GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.calc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  text-decoration: none;
  color: var(--text-dark);
  position: relative;
  overflow: hidden;
}

.calc-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 3px;
  width: 100%;
  background: var(--gradient);
  opacity: 0;
  transition: opacity .2s;
}

.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
  color: var(--text-dark)
}

.calc-card:hover::before {
  opacity: 1
}

.calc-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(37, 99, 235, .08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}

.calc-card.green .icon {
  background: rgba(16, 185, 129, .1);
  color: var(--secondary)
}

.calc-card.amber .icon {
  background: rgba(245, 158, 11, .1);
  color: #d97706
}

.calc-card.violet .icon {
  background: rgba(139, 92, 246, .1);
  color: #7c3aed
}

.calc-card h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em
}

.calc-card p {
  color: var(--text-light);
  font-size: 14px
}

/* FEATURED */
.featured {
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border)
}

/* SEO CONTENT */
.seo-content {
  padding: 64px 0;
  background: #fff;
  border-top: 1px solid var(--border)
}

.seo-content h2 {
  font-size: 30px;
  margin-bottom: 16px;
  letter-spacing: -.02em
}

.seo-content h3 {
  font-size: 22px;
  margin: 28px 0 12px
}

.seo-content p,
.seo-content li {
  color: var(--text-light);
  font-size: 16px;
  margin-bottom: 12px
}

.seo-content ul {
  padding-left: 24px;
  margin-bottom: 16px
}

.seo-content .container {
  max-width: 880px
}

/* FAQ */
.faq {
  padding: 64px 0
}

.faq .container {
  max-width: 820px
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: box-shadow .2s;
}

.faq-item:hover {
  box-shadow: var(--shadow)
}

.faq-q {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px
}

.faq-q::after {
  content: "+";
  font-size: 22px;
  color: var(--primary);
  transition: transform .2s
}

.faq-item.open .faq-q::after {
  content: "−"
}

.faq-a {
  color: var(--text-light);
  margin-top: 12px;
  display: none
}

.faq-item.open .faq-a {
  display: block
}

/* CALCULATOR PAGE */
.breadcrumb {
  font-size: 14px;
  color: var(--text-light);
  padding: 24px 0 0
}

.breadcrumb a {
  color: var(--text-light)
}

.breadcrumb a:hover {
  color: var(--primary)
}

.calc-page {
  padding: 32px 0 64px
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: start
}

.calc-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.calc-form-card h1 {
  font-size: 30px;
  letter-spacing: -.02em;
  margin-bottom: 8px
}

.calc-form-card .lead {
  color: var(--text-light);
  margin-bottom: 24px
}

.field {
  margin-bottom: 18px
}

.field label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-dark)
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text-dark);
  transition: border-color .2s, box-shadow .2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

/* RESULT BOX */
.result-box {
  background: #ecfdf5;
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  display: none;
}

.result-box.show {
  display: block;
  animation: fadeUp .3s ease
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.result-box h3 {
  color: var(--secondary-dark);
  font-size: 16px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em
}

.result-box .result-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -.02em
}

.result-box .result-meta {
  margin-top: 10px;
  color: var(--text-light);
  font-size: 14px
}

.result-box .result-meta div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0
}

.result-box .result-meta strong {
  color: var(--text-dark)
}

/* INFO PANEL */
.info-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.info-panel h3 {
  font-size: 20px;
  margin-bottom: 10px;
  letter-spacing: -.01em
}

.info-panel p,
.info-panel li {
  color: var(--text-light);
  font-size: 15px;
  margin-bottom: 10px
}

.info-panel ul {
  padding-left: 18px
}

.info-panel .formula {
  background: var(--bg);
  padding: 14px;
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  color: var(--text-dark);
  font-size: 14px;
  margin: 10px 0;
  border: 1px solid var(--border);
}

.error-msg {
  color: #dc2626;
  font-size: 14px;
  margin-top: 6px;
  display: none
}

.error-msg.show {
  display: block
}

/* FOOTER */
.site-footer {
  background: #0F172A;
  color: #cbd5e1;
  padding: 56px 0 24px;
  margin-top: 32px
}

.site-footer .brand {
  color: #fff
}

.site-footer .brand-name {
  color: #fff
}

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

.footer-tag {
  color: #94a3b8;
  margin-top: 12px;
  max-width: 280px
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em
}

.site-footer ul {
  list-style: none
}

.site-footer li {
  margin-bottom: 8px
}

.site-footer a {
  color: #94a3b8;
  font-size: 14px;
  transition: color .15s
}

.site-footer a:hover {
  color: #fff
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  font-size: 13px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 8px
}

/* RESPONSIVE */
@media (max-width:900px) {
  .calc-layout {
    grid-template-columns: 1fr
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media (max-width:768px) {
  .hero {
    padding: 56px 0 40px
  }

  .hero h1 {
    font-size: 38px
  }

  .hero p {
    font-size: 17px
  }

  .section-head h2 {
    font-size: 26px
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    gap: 6px;
  }

  .main-nav.open {
    display: flex
  }

  .main-nav a {
    padding: 12px 16px;
    border-radius: 8px
  }

  .main-nav a:hover {
    background: var(--bg)
  }

  .nav-toggle {
    display: flex
  }

  .search-wrap {
    flex-direction: column;
    padding: 10px
  }

  .search-wrap .btn {
    width: 100%
  }

  .hero-stats {
    gap: 24px
  }

  .calc-form-card {
    padding: 22px
  }

  .calc-form-card h1 {
    font-size: 24px
  }

  .field-row {
    grid-template-columns: 1fr
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center
  }
}

@media (max-width:480px) {
  .container {
    padding: 0 16px
  }

  .hero h1 {
    font-size: 30px
  }

  .footer-grid {
    grid-template-columns: 1fr
  }

  .card-grid {
    grid-template-columns: 1fr
  }

  .result-box .result-value {
    font-size: 26px
  }
}