:root {
  --primary: #6652c7;
  --primary-dark: #4e3ca9;
  --primary-soft: #eeeafd;
  --ink: #242332;
  --muted: #6f6d7d;
  --line: #e5e2ec;
  --surface: #ffffff;
  --background: #f7f6fa;
  --success: #23865f;
  --success-soft: #e3f5ed;
  --warning: #b97012;
  --warning-soft: #fff3db;
  --danger: #c7484e;
  --danger-soft: #fdebec;
  --shadow: 0 14px 36px rgba(42, 35, 73, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(102, 82, 199, 0.28);
  outline-offset: 2px;
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-capitalize {
  text-transform: capitalize;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 9px 20px rgba(102, 82, 199, 0.2);
}

.button--primary:hover {
  background: var(--primary-dark);
}

.button--ghost {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.button--full {
  width: 100%;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Cabeçalho */
.topbar {
  position: sticky;
  z-index: 100;
  top: 0;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid rgba(229, 226, 236, 0.9);
  backdrop-filter: blur(14px);
}

.topbar__inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, #7866dc, #5240ac);
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(102, 82, 199, 0.22);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.97rem;
}

.brand small {
  margin-top: -2px;
  color: var(--muted);
  font-size: 0.69rem;
}

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

.main-nav > a,
.nav-logout button {
  min-height: 40px;
  padding: 9px 13px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 0.89rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.main-nav > a:hover,
.main-nav > a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-logout {
  display: contents;
}

.nav-logout button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.menu-button > span:not(.sr-only) {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
  border-radius: 2px;
}

/* Estrutura geral */
.page {
  min-height: calc(100vh - 150px);
  padding-block: 46px 64px;
}

.page--narrow {
  width: min(830px, calc(100% - 40px));
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.dashboard-heading h1,
.form-page-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.dashboard-heading p,
.form-page-heading p {
  margin: 9px 0 0;
  color: var(--muted);
}

.month-control {
  display: grid;
  width: min(440px, 100%);
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  margin: 0 auto 24px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(42, 35, 73, 0.04);
  text-align: center;
}

.month-control span,
.month-control strong {
  display: block;
}

.month-control span {
  color: var(--muted);
  font-size: 0.72rem;
}

.month-control strong {
  font-size: 1rem;
}

.month-arrow {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
}

.month-arrow:hover {
  color: #fff;
  background: var(--primary);
}

.reminder-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  padding: 17px 19px;
  background: var(--warning-soft);
  border: 1px solid #f0d7a6;
  border-radius: 14px;
}

.reminder-banner__icon {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--warning);
  border-radius: 50%;
  font-weight: 900;
}

.reminder-banner h2,
.reminder-banner p {
  margin: 0;
}

.reminder-banner h2 {
  font-size: 0.98rem;
}

.reminder-banner p {
  color: #805d2c;
  font-size: 0.84rem;
}

.reminder-banner a {
  color: #80530d;
  font-size: 0.83rem;
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 46px;
}

.summary-card {
  min-width: 0;
  padding: 21px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 9px 24px rgba(42, 35, 73, 0.045);
}

.summary-card--main {
  color: #fff;
  background: linear-gradient(145deg, #6f5bd1, #503da7);
  border: 0;
  box-shadow: 0 16px 32px rgba(86, 66, 179, 0.22);
}

.summary-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.summary-card--main .summary-card__top {
  color: rgba(255, 255, 255, 0.77);
}

.summary-card > strong {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-card > small {
  color: var(--muted);
  font-size: 0.76rem;
}

.summary-icon {
  display: flex;
  width: 33px;
  height: 33px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px currentColor;
}

.status-dot--paid {
  color: rgba(35, 134, 95, 0.13);
  background: var(--success);
}

.status-dot--pending {
  color: rgba(185, 112, 18, 0.13);
  background: var(--warning);
}

.status-dot--overdue {
  color: rgba(199, 72, 78, 0.13);
  background: var(--danger);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.progress-track {
  appearance: none;
  height: 7px;
  flex: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  border-radius: 20px;
}

.progress-track::-webkit-progress-bar {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
}

.progress-track::-webkit-progress-value {
  background: #fff;
  border-radius: 20px;
}

.progress-track::-moz-progress-bar {
  background: #fff;
  border-radius: 20px;
}

.progress-row small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.68rem;
  white-space: nowrap;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.035em;
}

.count-badge {
  padding: 6px 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  font-size: 0.74rem;
  font-weight: 700;
}

.bill-list {
  display: grid;
  gap: 12px;
}

.bill-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(42, 35, 73, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bill-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.bill-card--paid {
  border-left-color: var(--success);
}

.bill-card--paid .bill-card__content h3 {
  color: #767483;
  text-decoration: line-through;
}

.bill-card--overdue {
  border-left-color: var(--danger);
}

.payment-form {
  align-self: center;
}

.payment-check {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: #fff;
  border: 2px solid #cbc7d7;
  border-radius: 11px;
  cursor: pointer;
}

.bill-card--paid .payment-check {
  background: var(--success);
  border-color: var(--success);
}

.payment-check:hover {
  border-color: var(--primary);
}

.bill-card__content {
  min-width: 0;
}

.bill-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.category-pill,
.overdue-pill,
.paid-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin: 0 4px 4px 0;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
}

.category-pill {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.overdue-pill {
  color: var(--danger);
  background: var(--danger-soft);
}

.paid-pill {
  color: var(--success);
  background: var(--success-soft);
}

.bill-value {
  font-size: 1.08rem;
  white-space: nowrap;
}

.bill-card h3 {
  margin: 4px 0 2px;
  font-size: 1.05rem;
}

.bill-description {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.73rem;
}

.bill-meta span {
  display: inline-flex;
  gap: 5px;
}

.bill-meta b {
  color: #4f4c5b;
}

.bill-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bill-actions a,
.bill-actions button {
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.bill-actions a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.bill-actions button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-state {
  padding: 54px 24px;
  background: #fff;
  border: 1px dashed #cec9db;
  border-radius: var(--radius);
  text-align: center;
}

.empty-state__icon {
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 16px;
  font-size: 1.6rem;
}

.empty-state h3 {
  margin: 0;
}

.empty-state p {
  margin: 7px 0 20px;
  color: var(--muted);
}

/* Formulários */
.form-page-heading {
  margin-bottom: 27px;
}

.back-link {
  display: block;
  width: max-content;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--primary);
}

.bill-form {
  display: grid;
  gap: 18px;
}

.form-card {
  padding: 25px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 9px 24px rgba(42, 35, 73, 0.04);
}

.form-card__heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}

.form-card__heading h2,
.form-card__heading p {
  margin: 0;
}

.form-card__heading h2 {
  font-size: 1.08rem;
}

.form-card__heading p {
  color: var(--muted);
  font-size: 0.78rem;
}

.step-number {
  display: flex;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 11px;
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid--three {
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
}

.field {
  display: grid;
  gap: 7px;
}

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

.field > span:first-child {
  color: #444250;
  font-size: 0.78rem;
  font-weight: 750;
}

.field > span b {
  color: var(--primary);
}

.field > span small {
  color: var(--muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fbfafc;
  border: 1px solid #dcd8e5;
  border-radius: 10px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(102, 82, 199, 0.09);
  outline: 0;
}

.field > small {
  color: var(--muted);
  font-size: 0.71rem;
}

.money-field,
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.money-field > span:first-child {
  position: absolute;
  z-index: 1;
  left: 13px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.money-field input {
  padding-left: 40px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  padding: 6px 8px;
  color: var(--primary);
  background: transparent;
  border: 0;
  font-size: 0.73rem;
  font-weight: 750;
  cursor: pointer;
}

.password-field input {
  padding-right: 70px;
}

.info-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  color: #544788;
  background: #f3f0fd;
  border-radius: 10px;
}

.info-note > span {
  display: flex;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.info-note p {
  margin: 0;
  font-size: 0.76rem;
}

.switch-row,
.check-row {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.switch-row > span:first-child {
  flex: 1;
}

.switch-row strong,
.switch-row small,
.check-row strong,
.check-row small {
  display: block;
}

.switch-row strong,
.check-row strong {
  font-size: 0.86rem;
}

.switch-row small,
.check-row small {
  color: var(--muted);
  font-size: 0.73rem;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 47px;
  height: 27px;
  flex: 0 0 auto;
  background: #cecbd5;
  border-radius: 30px;
  transition: background 0.18s ease;
}

.switch::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
  content: "";
  transition: transform 0.18s ease;
}

.switch-row input:checked + .switch {
  background: var(--primary);
}

.switch-row input:checked + .switch::after {
  transform: translateX(20px);
}

.switch-row input:focus-visible + .switch {
  outline: 3px solid rgba(102, 82, 199, 0.28);
  outline-offset: 2px;
}

.installment-fields {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: end;
  gap: 24px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.installment-fields.is-hidden {
  display: none;
}

.check-row {
  min-height: 70px;
  align-items: flex-start;
  padding: 13px;
  background: #faf9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  accent-color: var(--primary);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.validation-box,
.form-alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  color: #8c3035;
  background: var(--danger-soft);
  border: 1px solid #f5cdd0;
  border-radius: 11px;
  font-size: 0.82rem;
}

.validation-box ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* Avisos */
.flash-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 650;
}

.flash--success {
  color: #176b4c;
  background: var(--success-soft);
  border-color: #bfe6d6;
}

.flash--error {
  color: #8c3035;
  background: var(--danger-soft);
  border-color: #f2c9cc;
}

.flash--info {
  color: #51438a;
  background: var(--primary-soft);
  border-color: #d8d0f6;
}

.flash__close {
  padding: 0 3px;
  color: currentColor;
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Configurações */
.settings-grid {
  display: grid;
  gap: 16px;
}

.settings-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 9px 24px rgba(42, 35, 73, 0.04);
}

.settings-card__icon {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 13px;
  font-weight: 900;
}

.settings-card__label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.settings-card__content strong {
  overflow-wrap: anywhere;
}

.settings-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.config-status {
  padding: 5px 9px;
  border-radius: 30px;
  font-size: 0.68rem;
  font-weight: 800;
}

.config-status--ok {
  color: var(--success);
  background: var(--success-soft);
}

.config-status--warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.settings-card--action {
  grid-template-columns: 1fr auto;
}

.settings-card--action h2 {
  margin: 0;
  font-size: 1.06rem;
}

.setup-warning {
  padding: 17px 19px;
  color: #78541d;
  background: var(--warning-soft);
  border: 1px solid #efd8ad;
  border-radius: 13px;
}

.setup-warning p {
  margin: 5px 0 0;
  font-size: 0.8rem;
}

.setup-warning code {
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 5px;
}

/* Login */
.auth-body {
  background: #fff;
}

.login-page {
  display: grid;
  min-height: calc(100vh - 70px);
  grid-template-columns: minmax(390px, 0.8fr) minmax(500px, 1.2fr);
}

.login-card {
  width: min(430px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  padding-block: 45px;
}

.login-card__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 62px;
  font-weight: 850;
}

.brand__mark--large {
  width: 42px;
  height: 42px;
}

.login-card__heading h1 {
  max-width: 360px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.login-card__heading p {
  max-width: 365px;
  margin: 13px 0 27px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.login-card__note {
  margin: 22px 0 0;
  color: #9895a2;
  font-size: 0.72rem;
  text-align: center;
}

.login-visual {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  margin: 18px 18px 18px 0;
  color: #fff;
  background: linear-gradient(145deg, #30255f 0%, #5c48b9 54%, #826cdd 100%);
  border-radius: 28px;
  isolation: isolate;
}

.login-visual::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.visual-copy {
  position: absolute;
  top: 15%;
  left: 11%;
  width: min(490px, 74%);
}

.visual-copy__tag {
  display: inline-flex;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  font-size: 0.71rem;
  font-weight: 750;
}

.visual-copy h2 {
  margin: 20px 0 14px;
  font-size: clamp(2.6rem, 5.2vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.visual-copy p {
  width: min(440px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.73);
  font-size: 0.95rem;
}

.visual-card {
  position: absolute;
  z-index: 2;
  padding: 17px 19px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  box-shadow: 0 20px 45px rgba(27, 18, 67, 0.26);
  color: var(--ink);
}

.visual-card--one {
  right: 11%;
  bottom: 20%;
  width: 230px;
  transform: rotate(2deg);
}

.visual-card--one span,
.visual-card--one strong,
.visual-card--one small {
  display: block;
}

.visual-card--one span {
  color: var(--muted);
  font-size: 0.75rem;
}

.visual-card--one strong {
  margin: 4px 0;
  font-size: 1.5rem;
}

.visual-card--one small {
  color: var(--warning);
  font-weight: 700;
}

.visual-card--two {
  right: 29%;
  bottom: 10%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  font-size: 0.75rem;
  font-weight: 750;
  transform: rotate(-3deg);
}

.mini-check {
  display: flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--success);
  border-radius: 8px;
}

.visual-orb {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
}

.visual-orb--one {
  right: -120px;
  bottom: -130px;
  width: 450px;
  height: 450px;
  background: rgba(190, 171, 255, 0.32);
}

.visual-orb--two {
  right: 26%;
  bottom: 7%;
  width: 250px;
  height: 250px;
  border: 55px solid rgba(255, 255, 255, 0.07);
}

/* Rodapé e erro */
.footer {
  color: #8c8997;
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.72rem;
}

.error-page {
  display: flex;
  min-height: calc(100vh - 145px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 60px;
  text-align: center;
}

.error-code {
  color: var(--primary-soft);
  font-size: clamp(6rem, 18vw, 12rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.08em;
}

.error-page h1 {
  margin: 0;
  font-size: 2rem;
}

.error-page p {
  margin: 9px 0 22px;
  color: var(--muted);
}

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

  .login-page {
    grid-template-columns: 1fr 1fr;
  }

  .visual-copy h2 {
    font-size: clamp(2.6rem, 6vw, 3.7rem);
  }
}

@media (max-width: 760px) {
  .container,
  .page--narrow {
    width: min(100% - 28px, 1160px);
  }

  .topbar__inner {
    min-height: 68px;
  }

  .menu-button {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 62px;
    right: 14px;
    left: 14px;
    display: none;
    align-items: stretch;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: grid;
  }

  .main-nav > a,
  .nav-logout button {
    width: 100%;
    text-align: left;
  }

  .nav-logout {
    display: block;
  }

  .page {
    padding-block: 32px 48px;
  }

  .dashboard-heading {
    align-items: flex-start;
  }

  .dashboard-heading .button {
    padding-inline: 15px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .bill-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .bill-actions {
    grid-column: 2;
    justify-self: end;
  }

  .form-grid,
  .form-grid--three,
  .installment-fields {
    grid-template-columns: 1fr;
  }

  .login-page {
    display: block;
    min-height: 100vh;
  }

  .login-card {
    min-height: calc(100vh - 70px);
    padding-block: 34px;
  }

  .login-card__brand {
    margin-bottom: 48px;
  }

  .login-visual {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand small {
    display: none;
  }

  .dashboard-heading {
    display: grid;
  }

  .dashboard-heading .button {
    width: 100%;
  }

  .reminder-banner {
    grid-template-columns: auto 1fr;
  }

  .reminder-banner a {
    grid-column: 2;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-card {
    padding: 16px;
  }

  .summary-card--main {
    grid-column: 1 / -1;
  }

  .summary-card > strong {
    font-size: 1.25rem;
  }

  .summary-card:last-child {
    grid-column: 1 / -1;
  }

  .bill-card {
    position: relative;
    gap: 12px;
    padding: 16px;
  }

  .bill-card__title-row {
    display: grid;
  }

  .bill-value {
    grid-row: 1;
  }

  .bill-description {
    white-space: normal;
  }

  .bill-meta {
    display: grid;
    gap: 5px;
  }

  .bill-actions {
    width: 100%;
    justify-content: flex-start;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }

  .form-card {
    padding: 19px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-card,
  .settings-card--action {
    grid-template-columns: auto 1fr;
  }

  .config-status,
  .settings-card--action form {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .settings-card--action form .button {
    width: 100%;
  }

  .footer__inner {
    justify-content: center;
  }

  .footer__inner span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
