/* ============================================
   HOMEPAGE - "Our Services"

   Eight pastel service cards in three fixed columns. The last card in each column stretches so the
   columns end level. Each card has a large title with a round arrow, a
   one-line description, and a small illustrated preview rising from the
   bottom edge. Type comes from css/theme.css.
   Markup: tools/home_services.py.
   ============================================ */

.svc { background: #ffffff; }

/* ---------- Grid ---------- */
.svc__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.svc__col { display: flex; flex-direction: column; gap: 20px; }

/* The last card in each column takes up any spare height. Its preview panel
   grows with it, so the extra room sits inside the white panel rather than
   as a gap above it. */
.svc__col > .svc__card:last-child { flex-grow: 1; }
.svc__col > .svc__card:last-child > .preview { flex-grow: 1; }

/* ---------- Card tones ---------- */
.svc__card--pink  { --tone-a: #f9cad7; --tone-b: #fdeaef; --tone-c: #fff7f9; --tone-line: #f1c2cf; --tone-rgb: 255, 102, 141; }
.svc__card--peach { --tone-a: #fad9bd; --tone-b: #fdeddf; --tone-c: #fff9f3; --tone-line: #f1d3b9; --tone-rgb: 255, 171, 87; }
.svc__card--lilac { --tone-a: #d4cef7; --tone-b: #ece9fc; --tone-c: #f9f8ff; --tone-line: #d8d2f4; --tone-rgb: 139, 137, 240; }
.svc__card--sky   { --tone-a: #d2e7fa; --tone-b: #eaf4fd; --tone-c: #f8fbff; --tone-line: #cde1f4; --tone-rgb: 118, 202, 255; }
.svc__card--grey  { --tone-a: #e3e3ea; --tone-b: #f0f0f4; --tone-c: #fafafc; --tone-line: #e0e0e8; --tone-rgb: 190, 190, 210; }
.svc__card--rose  { --tone-a: #e8d2f4; --tone-b: #f4eafb; --tone-c: #fcf8ff; --tone-line: #e3cff0; --tone-rgb: 201, 58, 106; }

/* ---------- Card ---------- */
.svc__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px 32px 0;
  border: 1px solid var(--tone-line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--tone-a) 0%, var(--tone-b) 50%, var(--tone-c) 100%);
  overflow: hidden;
  text-decoration: none;
  break-inside: avoid;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.svc__card:hover {
  box-shadow: 0 30px 60px -40px rgba(35, 13, 79, 0.45);
  transform: translateY(-4px);
}

.svc__card:focus-visible { outline: 2px solid #3230e0; outline-offset: 3px; }

.svc__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.svc__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--heading-strong);
}

.svc__arrow {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--heading-strong);
  box-shadow: 0 6px 14px -8px rgba(35, 13, 79, 0.4);
  transition: background-color 0.25s ease, color 0.25s ease;
}

.svc__arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

.svc__card:hover .svc__arrow { background: #3230e0; color: #ffffff; }
.svc__card:hover .svc__arrow svg { transform: rotate(-45deg); }

.svc__desc {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 28px;
  color: #3a2c55;
}

/* ---------- Previews (decorative) ---------- */
.preview {
  position: relative;
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: #ffffff;
  box-shadow: 0 16px 36px -28px rgba(35, 13, 79, 0.35);
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}

.preview-title { font-size: 14px; font-weight: 500; color: var(--heading-strong); }
.preview-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.preview-skel {
  display: block;
  height: 8px;
  border-radius: 6px;
  background: #ecebf3;
}

.preview-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8f7ee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f9d55' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.preview-pill {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid #efe9f3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px -14px rgba(35, 13, 79, 0.4);
  font-weight: 500;
  color: var(--heading-strong);
}

/* Bookkeeping: month-end close */
.preview-steps {
  display: grid;
  gap: 14px;
  margin: 14px 0 0 10px;
  padding: 0 0 0 18px;
  list-style: none;
  border-left: 2px dashed rgba(var(--tone-rgb), 0.45);
}

.preview-steps li { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: 14px; align-items: center; }
.preview-steps b { display: block; margin-bottom: 7px; font-weight: 500; color: var(--heading-strong); }
.preview-steps .preview-skel + .preview-skel { margin-top: 6px; }

.preview-done {
  display: inline-block;
  float: right;
  margin: 14px 0 18px;
  padding: 4px 12px;
  border-radius: 8px;
  background: #e8f7ee;
  font-weight: 600;
  color: #146c3a;
}

/* Tax: returns by type */
.preview-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.preview-key i { width: 10px; height: 10px; border-radius: 3px; background: #9fa4f2; }
.preview-key i:nth-of-type(2) { margin-left: 8px; background: #d9dafb; }

/* The chart grows taller when its card is stretched */
.preview--bars { display: flex; flex-direction: column; }

.preview-bars {
  display: flex;
  flex-grow: 1;
  align-items: flex-end;
  justify-content: space-around;
  min-height: 150px;
  margin: 16px 0 0;
  padding-bottom: 24px;
  border-bottom: 1px solid #efeef5;
}

.preview-bars__group { position: relative; display: flex; align-self: stretch; align-items: flex-end; gap: 6px; }
.preview-bars__group i { width: 22px; height: var(--h); border-radius: 6px 6px 0 0; background: #9fa4f2; }
.preview-bars__group i + i { background: #d9dafb; }
.preview-bars__group em { position: absolute; left: 50%; bottom: -22px; font-size: 12px; font-style: normal; transform: translateX(-50%); }

/* Audit support: audit file status */
.preview-donut { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 14px; }

.preview-donut__chart {
  flex-shrink: 0;
  width: 170px;
  height: 85px;
  border-radius: 85px 85px 0 0;
  background: conic-gradient(from -90deg at 50% 100%, #3230e0 0deg 58deg, #8b89f0 58deg 104deg, #bdbbf6 104deg 146deg, #e4e3fb 146deg 180deg, transparent 180deg);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 44px, #000 45px);
  mask: radial-gradient(circle at 50% 100%, transparent 44px, #000 45px);
}

.preview-legend { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.preview-legend li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.preview-legend li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3230e0; }
.preview-legend li:nth-child(2)::before { background: #8b89f0; }
.preview-legend li:nth-child(3)::before { background: #bdbbf6; }
.preview-legend li:nth-child(4)::before { background: #e4e3fb; }

/* Payroll: pay run */
.preview-stepper {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 16px 0 6px;
  padding: 0;
  list-style: none;
}

.preview-stepper::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  border-top: 2px solid #ece8f2;
}

.preview-stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
.preview-stepper .preview-check { box-shadow: 0 0 0 4px #ffffff; }

/* Indirect tax: quarterly filings */
.preview--table { padding-top: 8px; padding-bottom: 8px; }

.preview-table__row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr)) 20px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #f0eef6;
}

.preview-table__row:last-child { border-bottom: 0; }
.preview-table__row span:first-child { font-weight: 500; color: var(--heading-strong); white-space: nowrap; }
.preview-table__row--head span:first-child { font-weight: 400; color: var(--ink-muted); }
.preview--table .preview-skel { height: 10px; background: #ebe5dc; }

/* Virtual CFO: 13-week cash forecast */
.preview--line svg { display: block; width: 100%; height: 130px; margin-top: 12px; }
.preview-line__bars rect { fill: #f1e6f6; }
.preview-line__area { fill: rgba(201, 58, 106, 0.08); }
.preview-line__stroke { fill: none; stroke: #c97ba0; stroke-width: 2.5; vector-effect: non-scaling-stroke; }

/* Shared small status tag in a preview header */
.preview-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: #e8f7ee;
  font-size: 12px;
  font-weight: 600;
  color: #146c3a;
}

/* Accounts payable & receivable: receivables ageing */
.preview-ageing { display: flex; gap: 4px; height: 14px; margin: 18px 0 14px; }
.preview-ageing span { border-radius: 4px; background: #3230e0; }
.preview-ageing span:nth-child(2) { background: #8b89f0; }
.preview-ageing span:nth-child(3) { background: #f4a3bb; }
.preview-ageing span:nth-child(4) { background: #ff668d; }

.preview-ageing-key {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.preview-ageing-key li { display: flex; align-items: center; gap: 8px; }
.preview-ageing-key li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3230e0; }
.preview-ageing-key li:nth-child(2)::before { background: #8b89f0; }
.preview-ageing-key li:nth-child(3)::before { background: #f4a3bb; }
.preview-ageing-key li:nth-child(4)::before { background: #ff668d; }

/* Financial reporting: year-end statement pack */
.preview-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
  padding: 0;
  list-style: none;
}

.preview-docs li { padding: 10px 12px; border: 1px solid #eeecf4; border-radius: 10px; background: #fbfaff; }
.preview-docs b { display: block; margin-bottom: 8px; font-weight: 500; color: var(--heading-strong); }
.preview-docs .preview-skel + .preview-skel { margin-top: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .svc__card { padding: 28px 26px 0; }
  .svc__title { font-size: 26px; }
}

@media (max-width: 1024px) {
  /* Two balanced columns: the fixed columns dissolve into one flow */
  .svc__grid { display: block; column-count: 2; column-gap: 20px; }
  .svc__col { display: contents; }
  .svc__card { margin-bottom: 20px; }
}

@media (max-width: 640px) {
  .svc__grid { column-count: 1; }
  .svc__card { padding: 24px 20px 0; border-radius: 20px; }
  .svc__title { font-size: 24px; }
  .preview-donut__chart { width: 140px; height: 70px; border-radius: 70px 70px 0 0; }
  .preview-bars__group i { width: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .svc__card,
  .svc__arrow,
  .svc__arrow svg { transition: none; }
  .svc__card:hover { transform: none; }
}
