/* ==========================================================================
   AutoTaxForms – Global dark theme stylesheet
   Replace your styles.css with this file.
   ========================================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --bg: #0b1220;
  --card: #0f172a;
  --muted: #94a3b8;
  --text: #e5edf7;
  --brand: #4f8cff;
  --brand-2: #2d56ff;
  --ring: #93c5fd;
  --divider: rgba(255, 255, 255, .08);
  --ok: #22c55e;
  --warn: #fbbf24;
  --error: #ef4444;
}

/* ---------- Base / Reset ---------- */
* {
  box-sizing: border-box
}

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

html {
  scroll-behavior: smooth
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ---------- Layout helpers ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px
}

section {
  padding: 56px 0;
  border-bottom: 1px solid var(--divider)
}

.muted {
  color: var(--muted)
}

.hidden {
  display: none !important
}

/* ---------- Header / Nav (shared with home) ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: linear-gradient(to bottom, rgba(11, 18, 32, .9), rgba(11, 18, 32, .6));
  border-bottom: 1px solid var(--divider);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: .2px;
  color: inherit
}

.brand b {
  font-weight: 800
}

.nav a.link {
  opacity: .9;
  padding: 8px 10px;
  border-radius: 8px
}

.nav a.link:hover {
  background: rgba(255, 255, 255, .06);
  opacity: 1
}

/* Logo image: use <img class="logo" src="..."> */
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  box-shadow: 0 8px 26px rgba(79, 140, 255, .35), inset 0 0 12px rgba(255, 255, 255, .18);
}

/* ---------- Page head / breadcrumbs ---------- */
.page-head {
  padding: 22px 0;
  border-bottom: 1px solid var(--divider)
}

.crumb {
  color: var(--muted);
  font-size: 14px
}

.crumb a {
  color: #cfe0ff
}

.page-title {
  font-size: 28px;
  margin: 8px 0 0
}

/* ---------- Cards & Surfaces ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}

.card+.card {
  margin-top: 16px
}

h1 {
  font-size: 34px;
  margin: 0 0 8px;
  line-height: 1.2
}

h2 {
  font-size: 20px;
  margin: 0 0 10px
}

h3 {
  font-size: 18px;
  margin: 0 0 8px
}

/* ---------- Grid / Columns ---------- */
.grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px
}

@media (max-width:980px) {
  .grid {
    grid-template-columns: 1fr
  }
}

/* ---------- Form controls ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.form-row.single {
  grid-template-columns: 1fr
}

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

label {
  font-weight: 600
}

.required::after {
  content: " *";
  color: var(--warn);
  font-weight: 800;
  margin-left: 2px
}

input,
select,
textarea {
  background: #2a334a;
  /* 明显比背景亮一层 */
  border: 1px solid #3e4a63;
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, background .2s;
}

input:focus,
select:focus,
textarea:focus {
  background: #34415c;
  /* 聚焦时再亮一点 */
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, .15);
}

.help,
.hint,
small.muted {
  font-size: 12px;
  color: var(--muted)
}

.error-text {
  font-size: 12px;
  color: var(--error)
}

/* Checkbox / Radio (basic) */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand)
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: .22s ease-in-out
}

.btn.primary {
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 10px 22px rgba(79, 140, 255, .35)
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(79, 140, 255, .45)
}

.btn.secondary {
  background: transparent;
  border-color: var(--divider);
  color: #dbe6ff
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, .06)
}

.btn.ghost {
  background: transparent;
  color: var(--muted)
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, .06)
}

/* ---------- Summary / Side panel ---------- */
.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.summary-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px dashed var(--divider);
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .02)
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, .03)
}

.note {
  font-size: 13px;
  color: #cad7ff
}

/* ---------- Sticky action bar (mobile) ---------- */
.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(11, 18, 32, .0), rgba(11, 18, 32, .85) 25%);
  padding: 16px;
  border-top: 1px solid var(--divider);
  display: none
}

.sticky-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: flex-end
}

@media (max-width:980px) {
  .sticky-bar {
    display: block
  }
}

/* ---------- Tables (if used) ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider)
}

.table th {
  text-align: left;
  color: #cfe0ff;
  font-weight: 700
}

.table tr:hover td {
  background: rgba(255, 255, 255, .03)
}

/* ---------- FAQ (optional) ---------- */
details {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0
}

summary {
  cursor: pointer;
  font-weight: 700
}

details[open] {
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02))
}

/* ---------- Footer ---------- */
.footer {
  padding: 36px 0;
  color: var(--muted);
  font-size: 13px
}

.footer .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--divider);
  padding-top: 16px;
  margin-top: 8px
}

.notice {
  font-size: 12px;
  color: var(--muted)
}

/* ---------- Responsive Typography ---------- */
@media (max-width:600px) {
  h1 {
    font-size: 28px
  }

  .page-title {
    font-size: 24px
  }
}

/* ---------- Print (keep PDFs & exports clean) ---------- */
@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #444;
    --divider: #ddd;
  }

  body {
    background: #fff;
    color: #000
  }

  header,
  .sticky-bar {
    display: none !important
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd
  }

  a {
    text-decoration: underline
  }
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  /* 黑 → 白 */
  cursor: pointer;
}

button.export {
  background: linear-gradient(135deg, #4f8cff, #2d56ff);
  color: #fff;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 140, 255, 0.4);
  transition: transform .2s, box-shadow .2s;
}

button.export {
  display: block;
  margin: 20px auto 40px;
  /* 上 15px, 下 50px, 居中 */
  background: linear-gradient(135deg, #4f8cff, #2d56ff);
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  /* 字体更大 */
  padding: 16px 36px;
  /* 按钮更大 */
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(79, 140, 255, 0.45);
  transition: transform .2s, box-shadow .2s;
}

button.export:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 28px rgba(79, 140, 255, 0.6);
}