:root {
    --green: #20c75a;
    --green-dark: #19ad4e;
    --white: #ffffff;
    --black: #111111;
    --muted: #707070;
    --line: #e7e7e7;
    --soft: #f6f6f6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--white);
    color: var(--black);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}
a { color: inherit; }

.text-muted { color: var(--muted) !important; }
.text-center { text-align: center !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mb-0 { margin-bottom: 0 !important; }
.ps-3 { padding-left: 20px !important; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.form-text { color: var(--muted); font-size: 12px; margin-top: 6px; }


button, input { font: inherit; }

.site-header,
.public-header {
    height: 58px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.site-header a,
.public-brand {
    color: var(--black);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: .01em;
}
.site-header { position: sticky; top: 0; z-index: 20; }

main { min-height: 100vh; }
.dashboard-shell,
.simple-page,
.public-page {
    width: min(100% - 28px, 720px);
    margin: 0 auto;
    padding: 24px 0 100px;
}

.dashboard-greeting {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 700;
}

.balance-card {
    background: var(--green);
    color: var(--white);
    border-radius: 22px;
    padding: 28px 24px 22px;
    margin-bottom: 38px;
}
.balance-label,
.rate-label {
    opacity: .92;
    font-size: 14px;
}
.balance-label { text-align: center; margin-bottom: 7px; }
.balance-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.balance-value {
    font-size: clamp(30px, 8vw, 46px);
    font-weight: 700;
    line-height: 1;
}
.eye-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    font-size: 24px;
}
.eye-button:hover { background: rgba(255,255,255,.12); }
.rate-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: center;
    margin-bottom: 28px;
}
.rate-value { margin-top: 7px; font-size: 20px; font-weight: 700; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-button,
.primary-button,
.secondary-button {
    min-height: 48px;
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 18px;
}
.hero-button { background: var(--white); color: var(--green-dark); }
.hero-button:hover { color: var(--green-dark); }
.secondary-action { background: transparent; color: var(--white); border: 1px solid var(--white); }
.secondary-action:hover { background: var(--white); color: var(--green-dark); }

.performance-section h2 {
    font-size: 22px;
    margin: 0 0 6px;
}
.performance-note { margin: 0 0 18px; }
.perf-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--line);
    margin-bottom: 8px;
}
.perf-tab {
    border: 0;
    background: var(--white);
    color: var(--muted);
    padding: 11px 4px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}
.perf-tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.performance-table-wrap { overflow-x: auto; }
.performance-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.performance-table th,
.performance-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}
.performance-table th { color: var(--muted); font-size: 11px; font-weight: 700; }
.performance-table td { font-size: 14px; }
.performance-table tfoot td { font-weight: 700; }

.simple-page h1,
.public-page h1 { font-size: 28px; margin: 0 0 22px; }
.back-link { display: inline-block; color: var(--green-dark); text-decoration: none; font-weight: 700; margin-bottom: 20px; }
.balance-line {
    background: var(--soft);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.simple-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.simple-form input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 15px;
    color: var(--black);
    background: var(--white);
    outline: none;
}
.simple-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(32,199,90,.12); }
.field-note { color: var(--muted); line-height: 1.55; margin: 8px 0 22px; }
.simple-form .primary-button { width: 100%; border: 0; background: var(--green); color: var(--white); }
.simple-form .primary-button:hover { background: var(--green-dark); }
.simple-form .primary-button:disabled { opacity: .45; cursor: not-allowed; }

.message {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    line-height: 1.5;
}
.success-message { background: var(--green); color: var(--white); }
.error-message { background: var(--black); color: var(--white); }
.success-message p { margin: 7px 0 0; }
.flash { width: min(100% - 28px, 720px); margin: 18px auto 0; padding: 12px 15px; border-radius: 12px; }

.account-name { font-size: 20px; font-weight: 700; }
.account-phone { color: var(--muted); margin-top: 4px; margin-bottom: 28px; }
.account-links { border-top: 1px solid var(--line); }
.account-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    font-weight: 600;
}
.account-links a:hover { color: var(--green-dark); }

.legal-page ol { padding-left: 22px; margin: 0; }
.legal-page li { padding: 0 0 17px 5px; line-height: 1.6; }
.faq-page details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-page summary { cursor: pointer; font-weight: 700; }
.faq-page details p { color: var(--muted); line-height: 1.6; margin: 12px 0 0; }

.statement-list { border-top: 1px solid var(--line); }
.statement-row { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.statement-row strong, .statement-row small { display: block; }
.statement-row small { color: var(--muted); margin-top: 4px; }
.statement-amount { white-space: nowrap; font-weight: 700; }
.statement-amount.positive { color: var(--green-dark); }
.statement-amount.negative { color: var(--black); }

.public-page { padding-top: 90px; text-align: center; }
.public-page p { color: var(--muted); margin-bottom: 30px; }
.public-actions { display: grid; gap: 12px; max-width: 340px; margin: auto; }
.primary-button { background: var(--green); color: var(--white); border: 0; }
.primary-button:hover { background: var(--green-dark); color: var(--white); }
.secondary-button { border: 1px solid var(--green); color: var(--green-dark); background: var(--white); }
.secondary-button:hover { background: var(--green); color: var(--white); }

/* Existing authentication pages */
.auth-wrap { width: min(100% - 28px, 460px); margin: 0 auto; padding: 50px 0 100px; }
.auth-card { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--white); }
.auth-card .auth-top { padding: 28px; text-align: center; background: var(--green); color: var(--white); }
.auth-card .auth-top img { display: none; }
.auth-card .auth-top .tagline { color: var(--white); font-size: 13px; }
.auth-card .auth-body { padding: 26px; }
.form-label { display: block; font-weight: 700; margin-bottom: 8px; }
.form-control { width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; }
.btn-brand { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; width: 100%; border: 0; border-radius: 25px; background: var(--green); color: var(--white); font-weight: 700; }
.btn-brand:hover { background: var(--green-dark); color: var(--white); }
.auth-card a { color: var(--green-dark); }
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.alert-danger { background: var(--black); color: var(--white); }
.alert-success { background: var(--green); color: var(--white); }

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    min-height: 70px;
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--white);
    border-top: 1px solid var(--line);
}
.bottom-nav a {
    color: var(--muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
}
.bottom-nav i { font-size: 20px; }
.bottom-nav a.active { color: var(--green-dark); }

@media (max-width: 520px) {
    .dashboard-shell, .simple-page, .public-page { width: min(100% - 22px, 720px); padding-top: 20px; }
    .balance-card { padding: 25px 15px 18px; border-radius: 19px; }
    .rate-row { gap: 8px; }
    .rate-value { font-size: 16px; }
    .hero-actions { gap: 8px; }
    .hero-button { min-height: 46px; }
    .perf-tabs { overflow-x: auto; }
    .perf-tab { min-width: 90px; }
    .statement-row { align-items: center; }
    .statement-amount { font-size: 13px; }
}


/* Withdrawal form refinements */
.simple-form {
    width: 100%;
    max-width: 720px;
}
.simple-form input[type="text"] {
    box-sizing: border-box;
    font-family: inherit;
    font-size: 15px;
}
.simple-form .primary-button {
    box-sizing: border-box;
}
@media (max-width: 520px) {
    .simple-page {
        padding-bottom: 95px;
    }
    .balance-line {
        align-items: center;
        flex-wrap: wrap;
    }
    .simple-form input[type="text"] {
        min-height: 54px;
    }
}
