:root {
    --ink: #17372f;
    --muted: #667a74;
    --forest: #163f34;
    --forest-2: #245e4e;
    --mint: #dff2e8;
    --cream: #f6f4ec;
    --paper: #fffef9;
    --line: #dce5df;
    --gold: #e8b84a;
    --red: #a73a3a;
    --shadow: 0 20px 60px rgba(24, 61, 50, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 90% 0%, #e4efe6 0, transparent 32rem), var(--cream); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input { font: inherit; }

.topbar { min-height: 72px; padding: 0 max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid rgba(22, 63, 52, .09); background: rgba(255, 254, 249, .88); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--forest); font-weight: 850; letter-spacing: .08em; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: block; flex: 0 0 auto; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.intro-logo { width: clamp(120px, 17vw, 180px); height: auto; display: block; margin: 0 0 24px; }
.topnav { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: .93rem; }
.topnav a { text-decoration: none; }
.topnav a:hover, .link-button:hover { color: var(--forest); }
.topnav form { margin: 0; }
.link-button { padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 80px; }
.auth-grid { min-height: calc(100vh - 200px); display: grid; grid-template-columns: 1.05fr .8fr; align-items: center; gap: clamp(48px, 8vw, 120px); }
.intro-panel { max-width: 620px; }
.intro-panel h1 { max-width: 580px; margin: 10px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 7vw, 5.7rem); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.intro-panel > p:not(.eyebrow) { max-width: 530px; color: var(--muted); font-size: 1.15rem; line-height: 1.7; }
.trust-note { display: inline-flex; margin-top: 24px; padding: 10px 14px; border: 1px solid #bfd8c8; border-radius: 999px; background: var(--mint); font-size: .9rem; }
.eyebrow { margin: 0 0 8px; color: var(--forest-2); font-size: .75rem; font-weight: 800; letter-spacing: .15em; }
.muted { color: var(--muted); }

.card { padding: clamp(24px, 4vw, 38px); border: 1px solid rgba(22, 63, 52, .10); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.card h1, .card h2 { margin: 6px 0 10px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.025em; }
.card h1 { font-size: clamp(2rem, 5vw, 3rem); }
.card h2 { font-size: 1.75rem; }
.auth-card { max-width: 480px; justify-self: end; width: 100%; }
.form-stack { display: grid; gap: 18px; margin-top: 28px; }
.form-stack label > span { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 700; }
.form-stack label small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.4; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], .copy-field input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #cbd8d1; border-radius: 12px; color: var(--ink); background: #fff; outline: none; }
input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 4px rgba(36, 94, 78, .12); }
.check-row { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.check-row span { margin: 0 !important; font-weight: 500 !important; }
.button { min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; font-weight: 750; cursor: pointer; }
.button.primary { color: white; background: var(--forest); box-shadow: 0 10px 24px rgba(22, 63, 52, .18); }
.button.primary:hover { background: var(--forest-2); }
.button.secondary { color: var(--forest); border: 1px solid #b8cec5; background: var(--paper); }
.button.danger { color: white; background: #8d3a36; }
.button.subtle { min-height: 42px; color: var(--forest); border: 1px solid #c9d7d1; background: #f8faf8; }
.button.full { width: 100%; }
.action-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.back-link { margin-bottom: 16px; color: var(--muted); font-size: .9rem; }
.form-link { color: var(--forest-2); font-size: .9rem; text-align: right; }
.search-form, .user-actions { display: flex; gap: 10px; }
.search-form { margin-bottom: 20px; }
.back-link a { text-decoration: none; }
.narrow-page { width: min(620px, 100%); margin: 30px auto; }

.notice { margin: 0 0 24px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: white; }
.notice.success { border-color: #b8dac5; background: #edf8f1; }
.notice.error { border-color: #e8bcbc; color: #792d2d; background: #fff2f2; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }
.link-notice { background: var(--mint); }
.link-notice strong, .link-notice small { display: block; }
.copy-field { margin: 10px 0; }
.copy-field input { background: rgba(255,255,255,.75); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-heading h1 { margin: 6px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.3rem, 5vw, 4.2rem); font-weight: 500; letter-spacing: -.04em; }
.status-pill { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: 999px; color: #18543c; background: #dff3e7; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.status-pill.neutral { color: #53605d; background: #e9ecea; }
.status-pill.warning { color: #7b5822; background: #fbebc8; }
.balance-card { min-height: 230px; padding: clamp(28px, 5vw, 54px); display: flex; flex-direction: column; justify-content: center; border-radius: 28px; color: white; background: linear-gradient(125deg, #12382f, #276f5c); box-shadow: 0 24px 70px rgba(16, 55, 45, .24); overflow: hidden; position: relative; }
.balance-card::after { content: "TXC"; position: absolute; right: -10px; bottom: -45px; color: rgba(255,255,255,.055); font-family: Georgia, serif; font-size: 12rem; line-height: 1; }
.balance-card p { margin: 0 0 6px; color: #b9d8ce; }
.balance-card strong { position: relative; z-index: 1; font-family: Georgia, serif; font-size: clamp(3rem, 8vw, 6rem); font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.balance-card strong span { font-family: inherit; font-size: .28em; letter-spacing: .04em; }
.balance-card small { margin-top: 14px; color: #b9d8ce; }
.content-grid { margin-top: 28px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 28px; align-items: start; }
.section-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.movement-row, .invite-row { padding: 17px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.movement-row:first-of-type { border-top: 0; }
.movement-row small, .invite-row small { display: block; margin-top: 5px; color: var(--muted); }
.amount { font-weight: 800; white-space: nowrap; }
.amount.positive { color: #19724f; }
.amount.negative { color: var(--red); }
.account-card dl { margin: 20px 0 0; }
.account-card dl div { padding: 14px 0; border-top: 1px solid var(--line); }
.account-card dt { color: var(--muted); font-size: .78rem; }
.account-card dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.empty-state { padding: 28px 0 10px; color: var(--muted); text-align: center; }
.empty-state p { margin-bottom: 0; }
.admin-grid { display: grid; grid-template-columns: .75fr 1.25fr; gap: 28px; align-items: start; }
.compact-form { margin-top: 22px; }
.confirmation-list { margin: 28px 0; }
.confirmation-list div { padding: 15px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.confirmation-list dt { color: var(--muted); }
.confirmation-list dd { margin: 0; text-align: right; font-weight: 750; }
.confirmation-list .confirm-amount { color: var(--forest); font-family: Georgia, serif; font-size: 1.8rem; }
.money-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.operations-card { margin-top: 28px; }
.operation-row { padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.operation-main { min-width: 0; }
.operation-main small, .operation-main code { display: block; margin-top: 5px; color: var(--muted); }
.operation-main code { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; }
.reverse-form { width: min(420px, 50%); display: flex; gap: 8px; }
.reverse-form input { min-width: 0; }

@media (max-width: 800px) {
    .topbar { min-height: 64px; padding: 0 18px; }
    .brand { font-size: .9rem; }
    .topnav { gap: 12px; font-size: .82rem; }
    .topnav a:first-child { display: none; }
    .page-shell { width: min(100% - 28px, 680px); padding: 30px 0 60px; }
    .auth-grid { min-height: auto; grid-template-columns: 1fr; gap: 34px; }
    .intro-panel { padding-top: 20px; }
    .intro-panel h1 { font-size: clamp(2.8rem, 14vw, 4.4rem); }
    .auth-card { justify-self: stretch; }
    .intro-logo { width: 112px; margin-bottom: 18px; }
    .content-grid, .admin-grid, .money-actions { grid-template-columns: 1fr; }
    .balance-card { min-height: 190px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
    .card { padding: 22px 18px; border-radius: 19px; }
    .movement-row, .invite-row { align-items: flex-start; flex-direction: column; gap: 9px; }
    .amount { align-self: flex-end; }
    .topnav { gap: 9px; }
    .topnav a { font-size: .75rem; }
    .operation-row { align-items: flex-start; flex-direction: column; }
    .reverse-form { width: 100%; flex-direction: column; }
}

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.recipient-field { position: relative; }
.phone-control { display: flex; align-items: stretch; }
.phone-prefix { min-width: 58px; display: grid; place-items: center; border: 1px solid #cbd8d1; border-right: 0; border-radius: 12px 0 0 12px; color: var(--muted); background: #f4f7f5; font-weight: 750; }
.phone-control input[type="tel"] { border-radius: 0 12px 12px 0; }
.recipient-suggestions { position: absolute; z-index: 20; top: calc(100% - 18px); left: 0; right: 0; max-height: 300px; overflow-y: auto; padding: 7px; border: 1px solid #cbd8d1; border-radius: 14px; background: #fff; box-shadow: 0 18px 42px rgba(22, 63, 52, .18); }
.recipient-suggestion { width: 100%; padding: 12px 13px; display: block; border: 0; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.recipient-suggestion:hover, .recipient-suggestion.active { background: var(--mint); }
.recipient-suggestion strong, .recipient-suggestion small { display: block; }
.recipient-suggestion small { margin-top: 3px !important; }

.phone-control input[type="tel"] { flex: 1; min-width: 0; }
