:root {
  color-scheme: light;
  --bg: #eef2f0;
  --ink: #14201c;
  --muted: #62716b;
  --line: #d8e0dc;
  --panel: #ffffff;
  --brand: #0d6b57;
  --brand-dark: #153f5c;
  --accent: #e0b64b;
  --soft: #e6f3ee;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, #dfeae5 0, var(--bg) 44%, #d5ded9 100%);
  color: var(--ink);
}

body {
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.phone-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  background: #f8faf8;
  box-shadow: 0 0 0 1px rgba(20, 32, 28, 0.06), 0 28px 80px rgba(20, 32, 28, 0.18);
  overflow: hidden;
}

.screen {
  display: none;
  min-height: 100svh;
  padding: max(16px, env(safe-area-inset-top)) 16px 96px;
}

.screen.active {
  display: block;
}

.locked .bottom-nav {
  display: none;
}

.auth-screen {
  display: none;
  align-content: center;
  padding-bottom: 28px;
  background:
    linear-gradient(160deg, rgba(13, 107, 87, 0.96), rgba(21, 63, 92, 0.9)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.13) 0 2px, transparent 2px 18px);
  color: #fff;
}

.auth-screen.active {
  display: grid;
}

.login-brand {
  display: grid;
  justify-items: center;
  min-height: auto;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 0 0 24px;
  text-align: center;
}

.login-brand img {
  margin-bottom: 12px;
}

.login-brand .eyebrow {
  margin-bottom: 10px;
}

/*
  Kept as a separate class for app screens; login is intentionally centered.
*/
.hero-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.login-brand img,
.brand-lockup img {
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(20, 32, 28, 0.2);
}

.login-brand h1 {
  margin: 8px 0 12px;
  color: #fff;
}

.login-brand p:not(.eyebrow) {
  max-width: 330px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.login-card {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  box-shadow: 0 22px 60px rgba(20, 32, 28, 0.22);
}

.signup-card {
  margin-top: 12px;
}

.auth-link-button {
  width: 100%;
  max-width: 360px;
  min-height: 48px;
  margin: 12px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 900;
}

.hero {
  min-height: clamp(286px, 40svh, 360px);
  margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 0;
  padding: max(18px, env(safe-area-inset-top)) 16px 82px;
  color: #fff;
  background:
    linear-gradient(150deg, rgba(13, 107, 87, 0.96), rgba(21, 63, 92, 0.92)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 18px);
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
}

.topbar,
.page-header,
.section-head,
.balance-panel,
.quick-actions,
.copy-row,
.timeline-item,
.brand-lockup {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(42px, 9svh, 82px);
}

.brand-lockup {
  gap: 10px;
  min-width: 0;
}

.brand-lockup span,
.brand-lockup strong {
  display: block;
  line-height: 1.05;
}

.brand-lockup span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
}

.brand-lockup strong {
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  gap: 4px;
  padding: 11px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.15);
}

.icon-button span {
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.75;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 11vw, 2.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.hero-copy {
  max-width: 340px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
  line-height: 1.48;
}

.balance-panel {
  position: relative;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px;
  margin-top: -52px;
  margin-bottom: 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 251, 238, 0.98)),
    var(--panel);
  border: 1px solid rgba(224, 182, 75, 0.38);
  box-shadow: 0 16px 42px rgba(20, 32, 28, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.balance-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #f5d875, var(--accent));
}

.balance-panel strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.9rem, 9vw, 2.42rem);
  line-height: 1;
  color: #141c18;
}

.muted {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6d6, #f1d37b);
  color: #675018;
  border: 1px solid rgba(155, 117, 25, 0.2);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.quick-actions {
  gap: 10px;
  margin-bottom: 24px;
}

.quick-actions button {
  display: grid;
  place-items: center;
  flex: 1;
  min-width: 0;
  min-height: 86px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f7faf8);
  color: var(--ink);
  font-size: clamp(0.74rem, 3.4vw, 0.86rem);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(20, 32, 28, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.quick-actions button:active {
  transform: translateY(1px) scale(0.99);
}

[hidden] {
  display: none !important;
}

.action-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin: 0 auto 9px;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(230, 243, 238, 0.95)),
    var(--soft);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(13, 107, 87, 0.06);
}

.action-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-block {
  margin-bottom: 24px;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.credit-grid article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

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

.credit-grid .upgrade-card {
  position: relative;
  padding: 18px;
  border-color: rgba(188, 138, 31, 0.44);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.92), transparent 24%),
    linear-gradient(135deg, #fff9df 0%, #f5dc8a 42%, #d8a93d 100%);
  box-shadow: 0 16px 34px rgba(143, 101, 22, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.credit-grid .upgrade-card::after {
  content: "";
  position: absolute;
  top: -38%;
  bottom: -38%;
  left: -32%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: rotate(18deg);
}

.upgrade-kicker {
  width: max-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  color: #6c5115;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.credit-grid strong {
  color: var(--brand-dark);
  font-size: 1.45rem;
  line-height: 1;
}

.upgrade-card strong {
  color: #2b220b;
  font-size: clamp(2rem, 9vw, 2.55rem);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.upgrade-card .muted,
.upgrade-card small {
  color: #604b18;
}

.credit-grid small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.moves-link {
  display: block;
  width: max-content;
  margin: 4px auto 18px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.round-add-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--soft);
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 900;
}

.section-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.payment-card,
.bank-card,
.form-card,
.admin-grid article {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.payment-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.payment-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.payment-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.payment-visual {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(145deg, #f8dc71, #d8ad37);
  box-shadow: inset 0 -16px 28px rgba(151, 103, 20, 0.15);
  overflow: hidden;
}

.payment-visual svg {
  width: 72px;
  height: 72px;
  fill: rgba(255, 255, 255, 0.28);
  stroke: rgba(20, 32, 28, 0.44);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline.full {
  margin-top: 18px;
}

.timeline-item {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-item small {
  color: var(--muted);
  font-weight: 800;
}

.file-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.amount {
  flex: 0 0 auto;
  color: var(--brand-dark);
  font-weight: 900;
}

.page-header {
  gap: 12px;
  min-height: 94px;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 8vw, 2rem);
}

.page-header .eyebrow {
  color: var(--brand);
}

.back-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}

.bank-card,
.form-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.bank-card {
  margin-bottom: 14px;
}

.bank-card strong {
  font-size: 1.08rem;
}

.bank-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.42;
}

.copy-row {
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #cbd8d2;
  border-radius: 14px;
  background: #f3f7f5;
  color: var(--brand-dark);
  font-weight: 900;
  text-align: left;
}

.copy-row::after {
  content: "Copiar";
  color: var(--brand);
  font-size: 0.75rem;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd8d2;
  border-radius: 14px;
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 50px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  padding: 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 107, 87, 0.14);
}

input[readonly] {
  background: linear-gradient(180deg, #fffdf5, #f7f2dd);
  border-color: rgba(224, 182, 75, 0.45);
  color: #27312d;
  cursor: default;
}

input[type="date"][readonly] {
  pointer-events: none;
}

.upload-box {
  min-height: 116px;
  place-items: center;
  padding: 18px;
  border: 1px dashed #9cb0a8;
  border-radius: 18px;
  background: #f4f8f6;
  text-align: center;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-box span {
  color: var(--brand);
  font-size: 1rem;
}

.upload-box small,
.form-note {
  color: var(--muted);
}

.form-note {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: 16px;
  font-weight: 900;
}

.primary-button {
  border: 0;
  background: var(--brand);
  color: #fff;
}

.secondary-button {
  width: 100%;
  border: 1px solid var(--line);
  background: #f3f7f5;
  color: var(--brand);
}

.danger-button {
  background: #fff4ef;
  border-color: #efc8ba;
  color: #9d3f2d;
}

.registered-state {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 245, 210, 0.96)),
    #f5dc8a;
  border: 1px solid rgba(188, 138, 31, 0.32);
}

.registered-state span {
  color: #6c5115;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.registered-state strong {
  color: #201909;
  font-size: 1.7rem;
  line-height: 1;
}

.registered-state em {
  color: #6c5115;
  font-style: normal;
  font-weight: 900;
}

.registered-state small {
  color: #604b18;
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-grid article {
  padding: 16px;
}

.admin-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.admin-config {
  margin-bottom: 16px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-card {
  display: block;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}

.user-card-button:active {
  transform: translateY(1px);
}

.user-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.user-card small {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.user-line {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 900;
}

.debt-line {
  color: #0d6b57;
}

.request-line {
  color: #b14637;
}

.pending-line {
  color: #a77810;
}

.user-detail-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
}

.user-detail-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1.4rem;
}

.user-detail-card small {
  color: var(--muted);
  font-weight: 800;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-metrics article {
  padding: 12px;
  border-radius: 16px;
  background: #f4f8f6;
}

.detail-metrics span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.detail-metrics strong {
  color: var(--brand-dark);
  font-size: 1.05rem;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-actions button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f4f8f6;
  color: var(--brand);
  font-weight: 900;
}

.admin-actions button:nth-child(2),
.admin-actions button:nth-child(4),
.admin-actions button:nth-child(7),
.admin-actions button:nth-child(8) {
  background: #fff4ef;
  border-color: #efc8ba;
  color: #9d3f2d;
}

.compact-form {
  margin-bottom: 12px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-height: 48px;
  padding: 7px 4px 6px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-size: clamp(0.72rem, 3.2vw, 0.78rem);
  font-weight: 900;
}

.bottom-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav span {
  line-height: 1;
}

.bottom-nav button.active {
  background: var(--soft);
  color: var(--brand);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: end center;
  background: rgba(20, 32, 28, 0.36);
  padding: 18px;
}

.sheet.open {
  display: grid;
}

.sheet-card {
  position: relative;
  width: min(100%, 394px);
  padding: 22px;
  border-radius: 24px;
  background: #fff;
}

.sheet-card p {
  color: var(--muted);
  line-height: 1.5;
}

.close-sheet {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #eef2f0;
  color: var(--ink);
  font-size: 1.1rem;
}

.toast {
  position: fixed;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  bottom: auto;
  z-index: 40;
  width: min(360px, calc(100% - 34px));
  padding: 13px 15px;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 16px 42px rgba(20, 32, 28, 0.16);
  font-weight: 900;
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .payment-card {
    grid-template-columns: 1fr;
  }

  .payment-visual {
    min-height: 76px;
  }

  .balance-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (min-width: 431px) {
  body {
    align-items: flex-start;
  }
}
