/* ============================================================
   India Calculator — Mobile Visual Master
   Breakpoints verified at 390px / 393px / 430px
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --navy-900: #071D49;
  --navy-800: #0A2A6B;
  --blue-700: #0E4E9E;
  --blue-600: #1360C4;
  --teal-600: #0E7E94;

  --ink: #0E2447;
  --ink-soft: #43567A;
  --card-bg: #FFFFFF;
  --card-soft: #F2F7FF;
  --line: #DCE7F5;

  --orange-500: #F97316;
  --orange-400: #FB923C;
  --orange-edge: #C2570C;

  --radius-card: 20px;
  --radius-box: 14px;

  --shadow-card: 0 10px 24px rgba(4, 20, 56, 0.28);
  --shadow-soft: 0 4px 12px rgba(4, 20, 56, 0.14);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  background: linear-gradient(168deg,
    var(--navy-900) 0%,
    var(--navy-800) 26%,
    var(--blue-700) 58%,
    var(--teal-600) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }
button { font-family: inherit; }

/* ============================================================
   TOP BAR — 只有圆形 Logo + India Calculator
   ============================================================ */
.topbar {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--blue-700) 100%);
}

.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  min-height: 72px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 8px rgba(194, 95, 12, 0.45);
}

/* Logo 上段：金橙底板 + 白色大写 A */
.logo-a {
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #FFC24B 0%, #F97316 100%);
  color: #FFFFFF;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(140, 60, 5, 0.3);
}

/* Logo 中段：白色横带 */
.logo-w {
  height: 4px;
  background: #FFFFFF;
}

/* Logo 下段：绿色区域 */
.logo-g {
  flex: 1 1 auto;
  background: linear-gradient(150deg, #2FB866 0%, #138808 100%);
}

/* 顶栏行下方的三色分隔横条（橙 / 白 / 绿，细长铺满） */
.topbar-band {
  height: 15px;
  background: linear-gradient(to bottom,
    #FF9933 0%, #FF9933 33.33%,
    #FFFFFF 33.33%, #FFFFFF 66.67%,
    #138808 66.67%, #138808 100%);
}

.site-name {
  margin: 0;
  color: #FFFFFF;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 14px 8px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 18px;
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-bar {
  flex: 0 0 auto;
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--orange-400), var(--orange-500));
}

/* ============================================================
   AGE CALCULATOR
   ============================================================ */

/* Segmented control: Age Today / Age on a Date */
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--card-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  margin-bottom: 18px;
}

.seg {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.seg.is-active {
  background: #FFFFFF;
  color: var(--navy-800);
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

/* Date fields */
.field { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.date-inputs {
  display: flex;
  gap: 10px;
}

.date-box {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 60px;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-box);
  outline: none;
  padding: 0 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.date-box::placeholder { color: #93A6C4; font-weight: 600; }

.date-box:focus {
  border-color: var(--blue-600);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(19, 96, 196, 0.18);
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  margin: 18px 0 4px;
}

.btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 54px;
  border-radius: var(--radius-box);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  padding: 12px 8px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, var(--orange-400) 0%, var(--orange-500) 100%);
  box-shadow: 0 4px 0 var(--orange-edge), 0 8px 16px rgba(201, 89, 12, 0.35);
  text-shadow: 0 1px 1px rgba(140, 60, 5, 0.35);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--orange-edge), 0 3px 8px rgba(201, 89, 12, 0.3);
}

.btn-reset {
  color: var(--navy-800);
  background: #FFFFFF;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 #C7D6EC;
}

.btn-reset:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #C7D6EC;
}

/* ---------- Result panel（展开动画，max-height 保证兼容） ---------- */
.result {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.38s ease, opacity 0.25s ease, margin-top 0.3s ease;
}

.result.is-open {
  max-height: 640px;
  opacity: 1;
  margin-top: 16px;
}

.result.is-open .result-inner {
  border-top: 2px dashed var(--line);
  padding-top: 16px;
}

.result-kicker {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--teal-600);
}

.result-main {
  margin: 0 0 14px;
  font-size: 24px;
  font-weight: 800;
  color: var(--navy-800);
  line-height: 1.25;
}

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

.stat {
  background: linear-gradient(160deg, #EAF3FF 0%, #DCEBFF 100%);
  border: 1px solid #CCE0FA;
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--blue-700);
  line-height: 1.2;
}

.stat span {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.stat-wide { grid-column: 1 / -1; }

.result-note {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  text-align: center;
}

.result-note strong { color: var(--ink); font-weight: 700; }

/* ============================================================
   ACCORDION — 其他计算器（默认收起）
   ============================================================ */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.acc-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}

.acc-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: var(--blue-700);
}

.acc-icon svg { width: 22px; height: 22px; }

/* 功能彩色图标底板（每个功能一个色系） */
.acc-icon.icon-indigo  { background: linear-gradient(150deg, #6366F1, #4338CA); box-shadow: 0 4px 9px rgba(67, 56, 202, 0.30); }
.acc-icon.icon-emerald { background: linear-gradient(150deg, #10B981, #047857); box-shadow: 0 4px 9px rgba(4, 120, 87, 0.28); }
.acc-icon.icon-amber   { background: linear-gradient(150deg, #FBBF24, #EA580C); box-shadow: 0 4px 9px rgba(234, 88, 12, 0.30); }
.acc-icon.icon-rose    { background: linear-gradient(150deg, #FB7185, #E11D48); box-shadow: 0 4px 9px rgba(225, 29, 72, 0.28); }
.acc-icon.icon-sky     { background: linear-gradient(150deg, #38BDF8, #0369A1); box-shadow: 0 4px 9px rgba(2, 105, 161, 0.28); }
.acc-icon.icon-violet  { background: linear-gradient(150deg, #A855F7, #7C3AED); box-shadow: 0 4px 9px rgba(124, 58, 237, 0.30); }
.acc-icon.icon-green   { background: linear-gradient(150deg, #4ADE80, #15803D); box-shadow: 0 4px 9px rgba(21, 128, 61, 0.28); }

/* Age Calculator 标题左侧彩色图标（蓝色系，与折叠卡图标同体系） */
.title-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: linear-gradient(150deg, #2DD4BF, #0D9488);
  box-shadow: 0 4px 9px rgba(13, 148, 136, 0.32);
}

.title-icon svg { width: 19px; height: 19px; }

.acc-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.acc-name {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-desc {
  font-size: 16.5px;
  line-height: 1.5;
  color: #1B3252;
}

/* "Days Between Dates Calculator" 标题在窄屏允许自然换行，不显示省略号 */
@media (max-width: 767px) {
  .acc-header[aria-controls="days-panel"] .acc-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

.acc-chevron {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #7B8DAD;
  transition: transform 0.25s ease;
}

.acc-card.is-open .acc-chevron { transform: rotate(180deg); }

.acc-card.is-open {
  box-shadow: var(--shadow-card);
}

.acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.acc-card.is-open .acc-panel { max-height: 1800px; }

.acc-panel-inner { padding: 0 16px 16px 70px; }
.acc-panel-inner > p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ============================================================
   BOTTOM SECTIONS — Article / Disclaimer / Contact
   ============================================================ */
.content-card {
  padding: 18px;
}

.content-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--navy-800);
}

.content-card p {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.7;
  color: #1B3252;
}

.content-card p:last-of-type { margin-bottom: 0; }

/* ---------- Article 文章版式 ---------- */
.article-card p { line-height: 1.75; font-size: 18px; color: #1B3252; }

.article-meta {
  margin: -2px 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #0A6B82;
}

.article-heading {
  margin: 16px 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy-800);
}

/* ---------- Disclaimer 免责声明（占位） ---------- */
.disclaimer-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.disclaimer-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #B45309;
  background: #FEF3E2;
  border: 1px solid #FBD38D;
}

.disclaimer-icon svg { width: 17px; height: 17px; }

.placeholder-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px dashed #E4C28A;
  border-radius: 12px;
  background: #FFFDF8;
  font-size: 14px;
  color: #7A6A52;
}

/* ---------- Contact Us 联系方式（占位） ---------- */
.contact-rows {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-soft);
}

.contact-row-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  background: linear-gradient(150deg, #3B82F6, #1D4ED8);
  box-shadow: 0 3px 7px rgba(29, 78, 216, 0.25);
}

.contact-row-icon svg { width: 19px; height: 19px; }

.contact-row-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.contact-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.contact-value { font-size: 16.5px; }

.contact-value.is-placeholder {
  color: #8494AE;
  font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 8px 16px 28px;
}

.site-footer p {
  margin: 0;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}

/* ============================================================
   MOBILE TUNING — 390 / 393 / 430 widths all single column
   ============================================================ */
@media (max-width: 430px) {
  .page { padding: 16px 12px 8px; }
  .card { padding: 18px 15px; }
  .site-name { font-size: 26px; }
  .result-main { font-size: 22px; }
}

@media (max-width: 360px) {
  .date-box { height: 54px; font-size: 18px; }
  .btn { font-size: 15px; }
  .acc-name { font-size: 15.5px; }
}


/* ============================================================
   FUNCTIONAL TOOL FORMS
   ============================================================ */
.validation {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  background: #FFF1F2;
  color: #B42318;
  border: 1px solid #FECDD3;
}
.validation[hidden] { display: none; }

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.tool-form label, .tool-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.tool-form input:not(.date-box), .tool-form select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #F8FBFF;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.tool-form input:focus, .tool-form select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(19,96,196,.12);
  background: #fff;
}
.tool-btn {
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(180deg, var(--blue-600), var(--blue-700));
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0A3D7D;
}
.tool-btn.secondary {
  background: #EEF5FF;
  color: var(--navy-800);
  border: 1px solid var(--line);
  box-shadow: none;
}
.tool-actions, .two-col, .three-col {
  display: grid;
  gap: 10px;
}
.tool-actions, .two-col { grid-template-columns: 1fr 1fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }
.tool-help {
  padding: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.45;
  color: var(--ink-soft) !important;
}
.health-note {
  border-left: 3px solid #22A35A;
  padding-left: 10px !important;
}
.tool-result {
  display: none;
  padding: 12px 13px !important;
  border-radius: 12px;
  background: #EAF3FF;
  border: 1px solid #CCE0FA;
  color: var(--ink) !important;
}
.tool-result.is-visible { display: flex; flex-direction: column; gap: 3px; }
.tool-result strong { font-size: 19px; color: var(--blue-700); }
.tool-result span { font-size: 12.5px; line-height: 1.45; }
.tool-result.is-error { background: #FFF1F2; border-color: #FECDD3; color: #B42318 !important; }
.tool-result.is-error strong { color: #B42318; }
.small-date { margin-top: -4px; }
.small-date .date-box { height: 48px; font-size: 17px; }
.gpa-rows { display: flex; flex-direction: column; gap: 8px; }
.gpa-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) 38px; gap: 7px; align-items: center; }
.gpa-row input { height: 43px !important; font-size: 14px !important; padding: 0 9px !important; }
.row-remove { width: 38px; height: 38px; border-radius: 10px; border: 1px solid #F5C2C7; background: #FFF1F2; color: #B42318; font-size: 22px; cursor: pointer; }

/* FAQ */
.faq-card details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq-card details:first-of-type { border-top: 0; padding-top: 2px; }
.faq-card summary { cursor: default; font-size: 18px; font-weight: 700; color: var(--ink); list-style: none; }
.faq-card summary::-webkit-details-marker { display: none; }
.faq-card summary::marker { display: none; content: ""; }
.faq-card details p { margin: 8px 0 0; font-size: 18px; line-height: 1.7; }

/* Contact and footer links */
a.contact-row { text-decoration: none; color: inherit; }
a.contact-row:hover { border-color: #B8CDEA; }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 auto 10px; max-width: 520px; }
.footer-nav a { color: rgba(255,255,255,.92); font-size: 17px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Legal / trust pages */
.legal-page { max-width: 760px; margin: 0 auto; padding: 24px 16px 10px; }
.legal-card { background: #fff; border-radius: 20px; padding: 24px; box-shadow: var(--shadow-card); }
.legal-card h1 { margin: 0 0 8px; color: var(--navy-800); font-size: 28px; }
.legal-card h2 { margin: 24px 0 8px; color: var(--navy-800); font-size: 19px; }
.legal-card p, .legal-card li { color: #1B3252; font-size: 17px; line-height: 1.7; }
.legal-card a { color: var(--blue-700); }
.legal-back { display: inline-block; margin-bottom: 14px; color: #fff; font-weight: 700; text-decoration: none; }
.legal-updated { margin: 0 0 18px !important; font-size: 13px !important; color: #7181A0 !important; }

@media (max-width: 430px) {
  .acc-panel-inner { padding-left: 16px; }
  .two-col, .tool-actions { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .three-col input { padding: 0 6px !important; text-align: center; }
  .legal-card { padding: 20px 16px; }
}

/* ============================================================
   TABLET & DESKTOP TUNING — 768 / 1024 / 1440 widths
   (mobile ≤ 430px untouched; min-width queries do not affect it)
   ============================================================ */
@media (min-width: 768px) {
  .page { max-width: 700px; padding: 22px 18px 10px; }
  .legal-page { max-width: 700px; }
}

@media (min-width: 1024px) {
  .page { max-width: 940px; padding: 26px 20px 12px; }
  .legal-page { max-width: 760px; }
}
