:root {
  color-scheme: light;
  --af-page: #ffffff;
  --af-card: #005c4b;
  --af-card-soft: #005c4b;
  --af-text: #ffffff;
  --af-muted: #ffffff;
  --af-border: #57eda8;
  --af-dark: #005c4b;
  --af-light: #57eda8;
  --af-white: #ffffff;
  --af-on-dark: #ffffff;
  --af-danger: #ffffff;
  --af-danger-soft: #005c4b;
  --af-focus: #57eda8;
  --af-success-circle: #005c4b;
  --af-success-check: #57eda8;
  --af-shadow: 0 18px 48px rgba(0, 92, 75, .20);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

body.afdrag-widget-page {
  background: var(--af-page);
  color: var(--af-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.5;
}

button, input { font: inherit; }

button:focus-visible, input:focus-visible {
  outline: 4px solid color-mix(in srgb, var(--af-focus) 26%, transparent);
  outline-offset: 2px;
}

h1:focus, h2:focus { outline: none; }

.af-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 24px 24px 54px;
}

.af-topbar {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--af-dark);
}

.af-back {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--af-dark);
  border-radius: 17px;
  background: var(--af-light);
  color: var(--af-white);
  cursor: pointer;
  font-size: 27px;
  box-shadow: 0 6px 16px rgba(0, 92, 75, .16);
}

.af-back[hidden] { visibility: hidden; display: grid; }

.af-progress-copy { text-align: center; }
.af-progress-copy strong { display: block; font-size: 15px; }
.af-progress-copy span { color: var(--af-dark); font-size: 14px; }

.af-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--af-dark);
  margin-bottom: 28px;
}

.af-progress > span {
  display: block;
  width: 16.66%;
  height: 100%;
  border-radius: inherit;
  background: var(--af-light);
  transition: width .24s ease;
}

.af-card {
  border: 1px solid var(--af-border);
  border-radius: 32px;
  background: var(--af-card);
  box-shadow: var(--af-shadow);
  padding: clamp(24px, 5vw, 56px);
}

.af-screen[hidden] { display: none; }

.af-eyebrow {
  margin: 0 0 8px;
  color: var(--af-light);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1, h2 { color: var(--af-text); line-height: 1.08; }
h1 { margin: 0 0 18px; font-size: clamp(34px, 8vw, 52px); }
h2 { margin: 0 0 14px; font-size: clamp(28px, 6vw, 40px); }
.af-lead { margin: 0 0 28px; color: var(--af-muted); font-size: 19px; }

.af-field { display: grid; gap: 9px; margin-bottom: 20px; }
.af-field label { font-weight: 800; }
.af-field small { color: var(--af-muted); }

.af-field input {
  width: 100%;
  min-height: 60px;
  border: 2px solid var(--af-white);
  border-radius: 16px;
  background: var(--af-white);
  color: var(--af-dark);
  padding: 13px 16px;
}

.af-field input:focus { border-color: var(--af-focus); }

.af-primary {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  background: var(--af-light);
  color: var(--af-white);
  cursor: pointer;
  font-weight: 900;
  margin-top: 26px;
  padding: 14px 20px;
}

.af-primary:hover { filter: brightness(1.06); }
.af-primary:disabled { cursor: not-allowed; filter: grayscale(.25); opacity: .55; }

.af-secondary {
  display: flex;
  width: 100%;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--af-light);
  border-radius: 18px;
  background: var(--af-dark);
  color: var(--af-white);
  cursor: pointer;
  font-weight: 900;
  margin-top: 12px;
  padding: 14px 20px;
}
.af-secondary:hover { background: rgba(87, 237, 168, .12); }

.af-search-button { position: relative; overflow: hidden; }
.af-search-button-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--af-light);
  transition: width .16s linear;
}
.af-search-button-content {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.af-search-button-content strong { min-width: 0; font: inherit; font-weight: 900; }
.af-search-button[data-searching="true"] {
  border: 2px solid var(--af-white);
  background: rgba(255,255,255,.22);
  opacity: 1;
  filter: none;
}
.af-search-button[data-overdue="true"] .af-search-button-content { justify-content: space-between; text-align: left; }
.af-search-button[data-overdue="true"] .af-search-button-fill { animation: af-search-pulse 1.15s ease-in-out infinite alternate; }

@keyframes af-search-pulse {
  from { opacity: .58; }
  to { opacity: 1; }
}

.af-error {
  margin: 18px 0 0;
  border-radius: 14px;
  background: var(--af-danger-soft);
  color: var(--af-danger);
  font-weight: 750;
  padding: 14px 16px;
}

.af-case-list { display: grid; gap: 16px; margin-top: 24px; }
.af-case {
  border: 2px solid var(--af-light);
  border-radius: 20px;
  background: var(--af-card-soft);
  padding: 19px;
}
.af-case--eligible { border-color: var(--af-light); }
.af-case--collection { border-color: var(--af-danger); background: var(--af-danger-soft); color: var(--af-white); }
.af-case-head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 14px; }
.af-case-title { margin: 0; font-size: 21px; font-weight: 900; }
.af-case-plate { margin: 2px 0 0; color: var(--af-muted); font-weight: 700; letter-spacing: .06em; }
.af-case-amount { white-space: nowrap; color: var(--af-light); font-size: 21px; font-weight: 900; }
.af-case--collection .af-case-amount { color: var(--af-danger); }
.af-case--collection .af-case-plate { color: var(--af-white); }
.af-case-message { margin: 14px 0 0; color: var(--af-danger); font-weight: 700; }
.af-breakdown { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--af-border); }
.af-breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; font-size: 15px; }
.af-breakdown-row strong { white-space: nowrap; }
.af-case-meta { display: grid; gap: 4px; margin-top: 12px; color: var(--af-white); font-size: 14px; line-height: 1.35; }
.af-case-meta span { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.af-case-meta strong { color: var(--af-light); }
.af-tooltip { display: inline; position: relative; }
.af-tooltip button { border: 0; background: transparent; color: var(--af-light); cursor: pointer; font-size: 13px; font-weight: 900; text-decoration: underline; }
.af-tooltip span {
  display: none;
  position: absolute;
  z-index: 3;
  left: 0;
  top: calc(100% + 8px);
  width: min(330px, 75vw);
  border: 1px solid var(--af-border);
  border-radius: 14px;
  background: var(--af-card-soft);
  box-shadow: var(--af-shadow);
  color: var(--af-text);
  padding: 14px;
  font-size: 14px;
  font-weight: 500;
}
.af-tooltip button[aria-expanded="true"] + span { display: block; }

.af-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin-top: 22px;
  border: 2px solid var(--af-light);
  border-radius: 18px;
  background: var(--af-card-soft);
  padding: 18px;
  font-weight: 900;
}

.af-month-value { text-align: center; margin: 22px 0; }
.af-month-value strong { display: block; color: var(--af-light); font-size: 64px; line-height: 1; }
.af-month-value span { color: var(--af-muted); font-weight: 800; }
.af-range { width: 100%; accent-color: var(--af-light); }
.af-range-labels { display: flex; justify-content: space-between; color: var(--af-muted); font-size: 14px; font-weight: 750; }

.af-payment-card {
  margin-top: 26px;
  border: 2px solid var(--af-light);
  border-radius: 24px;
  background: var(--af-dark);
  color: var(--af-white);
  padding: 26px;
  text-align: center;
}
.af-payment-card p { margin: 0 0 7px; }
.af-payment-card .af-big { color: var(--af-light); font-size: clamp(48px, 11vw, 70px); font-weight: 900; line-height: 1.1; }
.af-price-lines { display: grid; gap: 8px; margin-top: 22px; padding-top: 19px; border-top: 1px solid rgba(255,255,255,.2); }
.af-price-line { display: grid; grid-template-columns: 1fr auto; gap: 16px; text-align: left; }
.af-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 22px; padding-top: 19px; border-top: 1px solid rgba(255,255,255,.2); text-align: left; }
.af-date { display: grid; align-content: start; gap: 3px; min-width: 0; }
.af-date span { color: rgba(255,255,255,.72); }
.af-date strong { overflow-wrap: anywhere; }

.af-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.af-summary { display: grid; gap: 18px; }
.af-final-details {
  margin: 22px 0;
  border: 2px solid var(--af-light);
  border-radius: 18px;
  background: var(--af-dark);
  color: var(--af-white);
  padding: 18px;
  font-weight: 750;
  line-height: 1.55;
}
.af-summary-box { border: 2px solid var(--af-light); border-radius: 18px; background: var(--af-card-soft); padding: 18px; }
.af-summary-box h3 { margin: 0 0 12px; }
.af-schedule { display: grid; gap: 7px; }
.af-schedule-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: baseline; font-size: 15px; }
.af-fee-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-top: 8px; }
.af-note { color: var(--af-muted); font-size: 14px; }
.af-consent {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 13px;
  margin-top: 22px;
  border: 2px solid var(--af-light);
  border-radius: 18px;
  background: var(--af-card-soft);
  cursor: pointer;
  padding: 17px;
  font-weight: 750;
}
.af-consent input { width: 24px; height: 24px; margin: 0; accent-color: var(--af-light); }
.af-success-card { text-align: center; }
.af-success-card .af-lead { max-width: 620px; margin-inline: auto; }
.af-success-mark {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  margin: 26px auto;
  border-radius: 50%;
  border: 2px solid var(--af-light);
  background: var(--af-success-circle);
  color: var(--af-success-check);
  font-size: 52px;
  font-weight: 900;
}

.af-add-choice, .af-add-form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--af-border); }
.af-add-choice[hidden], .af-add-form[hidden], .af-add-success[hidden] { display: none; }
.af-add-choice h3, .af-add-form h3 { margin: 0 0 8px; font-size: 23px; }
.af-add-choice p, .af-add-form > p { margin: 0; }
.af-add-form .af-field { margin-top: 20px; }
.af-add-success {
  margin: 18px 0 0;
  border: 2px solid var(--af-light);
  border-radius: 14px;
  background: var(--af-dark);
  color: var(--af-white);
  font-weight: 800;
  padding: 14px 16px;
}

.af-unavailable {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  border: 2px solid var(--af-light);
  border-radius: 20px;
  background: var(--af-card-soft);
  padding: 20px;
}
.af-unavailable[hidden] { display: none; }
.af-unavailable p { margin: 0; color: var(--af-white); }

.af-logout {
  border: 0;
  background: transparent;
  color: var(--af-dark);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}
.af-manage-banner {
  margin-bottom: 16px;
  border: 1px solid var(--af-light);
  border-radius: 18px;
  background: var(--af-dark);
  color: var(--af-white);
  padding: 16px 18px;
  font-weight: 800;
}
.af-manage-banner[data-tone="neutral"] { background: var(--af-card-soft); color: var(--af-white); }
.af-manage-screen[hidden], .af-manage-screen [hidden] { display: none !important; }
.af-code-input {
  text-align: center;
  font-size: clamp(30px, 9vw, 46px) !important;
  font-weight: 900;
  letter-spacing: .24em;
}
.af-plan-list, .af-action-list { display: grid; gap: 14px; }
.af-plan-choice, .af-action-choice {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 2px solid var(--af-light);
  border-radius: 20px;
  background: var(--af-card-soft);
  color: var(--af-white);
  cursor: pointer;
  padding: 19px;
  text-align: left;
}
.af-plan-choice:hover, .af-plan-choice:focus-visible,
.af-action-choice:hover, .af-action-choice:focus-visible { border-color: var(--af-white); box-shadow: 0 0 0 4px var(--af-light); outline: none; }
.af-plan-choice > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.af-plan-choice strong, .af-action-choice strong { font-size: 20px; font-weight: 900; }
.af-plan-choice em { color: var(--af-light); font-size: 14px; font-style: normal; font-weight: 900; }
.af-plan-choice > span:not(:first-child), .af-action-choice span { color: var(--af-muted); }
.af-plan-choice b { color: var(--af-light); font-size: 17px; }
.af-action-choice:disabled { cursor: not-allowed; opacity: .48; }
.af-plan-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.af-plan-facts > div {
  display: grid;
  gap: 5px;
  border-radius: 18px;
  border: 2px solid var(--af-light);
  background: var(--af-card-soft);
  padding: 17px;
}
.af-plan-facts span { color: var(--af-muted); font-size: 14px; }
.af-plan-facts strong { font-size: 19px; }
.af-manage-screen .af-summary-box { margin-top: 16px; }
.af-manage-screen .af-summary-box h2 { margin: 0 0 12px; font-size: 19px; }
.af-closed-summary {
  border: 2px solid var(--af-light);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
  text-align: center;
}
.af-closed-summary h2 { margin: 0; font-size: clamp(30px, 5vw, 46px); }
.af-closed-summary .af-lead { max-width: 680px; margin: 0 auto 24px; }
.af-closed-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}
.af-closed-facts > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--af-light);
  border-radius: 17px;
  padding: 15px 17px;
}
.af-closed-facts span { color: var(--af-muted); font-size: 14px; }
.af-closed-facts strong { font-size: 18px; }
.af-summary-note {
  margin: 0 0 13px;
  color: var(--af-muted);
  font-size: 14px;
  line-height: 1.5;
}
.af-balance-breakdown .af-summary-note { margin: 13px 0 0; }
.af-manage-case-row { margin-top: 9px; }
.af-manage-schedule-row {
  grid-template-columns: minmax(150px, .95fr) 95px minmax(180px, 1.6fr) 80px;
}
.af-manage-schedule-row strong {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-align: right;
}
.af-manage-schedule-row small { color: var(--af-muted); font-size: 12px; font-weight: 800; }
.af-schedule-detail { min-width: 0; }
.af-plan-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.af-plan-action {
  min-width: 0;
  min-height: 72px;
  margin-top: 0;
  padding: 12px 14px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}
.af-confirm-box {
  margin-top: 18px;
  border: 2px solid var(--af-light);
  border-radius: 20px;
  background: var(--af-card-soft);
  padding: 20px;
  font-size: 18px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  body.afdrag-widget-page { font-size: 17px; }
  .af-shell { padding: 14px 12px 36px; }
  .af-card { border-radius: 22px; padding: 23px 18px; }
  .af-grid-two { grid-template-columns: 1fr; }
  .af-dates { grid-template-columns: 1fr; gap: 14px; }
  .af-case-head { grid-template-columns: 1fr; }
  .af-case-amount { margin-top: 3px; }
  .af-schedule-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .af-plan-facts { grid-template-columns: 1fr; }
  .af-closed-facts { grid-template-columns: 1fr; }
  .af-plan-actions { gap: 8px; }
  .af-plan-action { min-height: 78px; padding: 10px 7px; font-size: 13px; }
  .af-manage-schedule-row { grid-template-columns: minmax(0, 1fr) auto; }
  .af-schedule-month { grid-column: 1; grid-row: 1; }
  .af-schedule-amount { grid-column: 2; grid-row: 1; }
  .af-schedule-detail, .af-schedule-status { grid-column: 1 / -1; }
  .af-search-button[data-overdue="true"] .af-search-button-content strong { font-size: 15px; line-height: 1.25; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}
