/* ==========================================================================
   SaqueReal — style.css  (mobile-first)
   Verde da marca #009C3B (theme-color do site) + dourado de apoio.
   ========================================================================== */

:root {
    --brand: #009C3B;
    --brand-btn: #008A34;
    --brand-btn-hover: #007A2E;
    --brand-link: #007A2F;
    --brand-deep: #00401D;
    --brand-mid: #006B2B;
    --brand-50: #EEF8F1;
    --brand-100: #D9F0E2;
    --gold: #FFC72C;
    --gold-soft: #FFF6DA;
    --gold-ink: #6B4E00;

    --ink: #0E1B14;
    --text: #1E2B24;
    --muted: #5F6D66;
    --line: #E2E8E4;
    --line-strong: #C9D3CD;
    --bg: #F4F7F5;
    --surface: #FFFFFF;

    --danger: #C63B3B;
    --danger-bg: #FDEEEE;
    --danger-line: #F3C6C6;
    --success-bg: #E8F6ED;
    --success-line: #B9E2C6;
    --info-bg: #EAF2FB;
    --info-line: #C5D9F0;

    --r-sm: 6px;
    --r: 8px;
    --r-lg: 10px;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

    --shadow-sm: 0 1px 2px rgba(14, 27, 20, .06);
    --shadow-md: 0 10px 30px rgba(14, 27, 20, .08);

    --sidebar-w: 248px;
    --bottom-nav-h: 64px;
    --topbar-h: 60px;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

body.is-auth {
    background: var(--surface);
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    color: var(--brand-link);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.is-hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ---------- botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    font: 600 16px/1 var(--font-body);
    border: 1px solid transparent;
    border-radius: var(--r);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--brand-btn);
    color: #fff;
}

.btn-primary:hover {
    background: var(--brand-btn-hover);
}

.btn-outline {
    background: #fff;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-outline:hover {
    background: var(--bg);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
}

.btn[disabled] {
    opacity: .65;
    cursor: not-allowed;
}

.btn-spinner,
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
}

.btn-outline .btn-spinner {
    border-color: rgba(0, 0, 0, .15);
    border-top-color: var(--brand-btn);
}

.spinner {
    display: inline-block;
    border-color: var(--brand-100);
    border-top-color: var(--brand);
}

.spinner-lg {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- formulários ---------- */
.field {
    margin-bottom: 16px;
}

.field label:not(.check) {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder {
    color: #9AA7A0;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 156, 59, .18);
}

select.input {
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235F6D66' stroke-width='1.8' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.field.is-invalid .input {
    border-color: var(--danger);
}

.field.is-invalid .input:focus {
    box-shadow: 0 0 0 3px rgba(198, 59, 59, .16);
}

.field-error {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    color: var(--danger);
}

.field.is-invalid .field-error {
    display: block;
}

.field-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.input-wrap {
    position: relative;
}

.input-wrap .input {
    padding-right: 48px;
}

.toggle-pass {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 0 var(--r) var(--r) 0;
}

.toggle-pass:hover {
    color: var(--ink);
}

.phone-group {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 8px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    cursor: pointer;
}

.check input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: var(--brand);
}

.row-end {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 16px;
    font-size: 14px;
}

.strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.strength span {
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    transition: background .2s;
}

.strength[data-level="1"] span:nth-child(-n+1) {
    background: var(--danger);
}

.strength[data-level="2"] span:nth-child(-n+2) {
    background: #E0A100;
}

.strength[data-level="3"] span:nth-child(-n+3) {
    background: #5BB36F;
}

.strength[data-level="4"] span:nth-child(-n+4) {
    background: var(--brand);
}

/* ---------- alertas ---------- */
.form-message:empty {
    display: none;
}

.form-message {
    margin-bottom: 16px;
}

.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--r);
    font-size: 14px;
    line-height: 1.45;
}

.alert i {
    margin-top: 2px;
}

.alert-danger {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: #8F2424;
}

.alert-success {
    background: var(--success-bg);
    border-color: var(--success-line);
    color: #0B5A27;
}

.alert-warning {
    background: var(--gold-soft);
    border-color: #F1DC9A;
    color: var(--gold-ink);
}

.alert-info {
    background: var(--info-bg);
    border-color: var(--info-line);
    color: #1F4B7A;
}

/* ---------- estados (verificação, 404) ---------- */
.state-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: var(--r-lg);
    background: var(--brand-50);
    color: var(--brand);
    font-size: 24px;
}

.state-icon.is-success {
    background: var(--success-bg);
    color: var(--brand);
}

.state-icon.is-error {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ---------- AUTH ---------- */
.auth {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
        linear-gradient(160deg, rgba(0, 64, 29, .86) 0%, rgba(0, 107, 43, .76) 52%, rgba(0, 156, 59, .68) 100%),
        url("../images/auth-bg.jpg") center / cover no-repeat,
        linear-gradient(160deg, var(--brand-deep) 0%, var(--brand-mid) 52%, var(--brand) 100%);
}

.auth-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.auth-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%);
    mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
}

.orb-1 {
    width: 360px;
    height: 360px;
    right: -100px;
    top: -120px;
    background: rgba(255, 199, 44, .26);
}

.orb-2 {
    width: 460px;
    height: 460px;
    left: -180px;
    bottom: -200px;
    background: rgba(60, 200, 110, .30);
}

.brand-chip {
    display: inline-flex;
    align-self: flex-start;
    background: #fff;
    padding: 8px 12px;
    border-radius: var(--r);
}

.brand-chip:hover {
    text-decoration: none;
}

.brand-chip img {
    height: 30px;
    width: auto;
}

.auth-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--muted);
    margin-bottom: 24px;
}

.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-link);
    background: var(--brand-50);
    border-radius: var(--r-sm);
}

/* ----- login e páginas de acesso: hero + card flutuante ----- */
.auth-shell {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-hero {
    padding: calc(20px + env(safe-area-inset-top)) 20px 24px;
    color: #fff;
}

.hero-copy {
    margin-top: 20px;
}

.hero-tag {
    display: none;
}

.hero-copy h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 26px;
    line-height: 1.15;
}

.hero-copy p {
    margin-top: 8px;
    font-size: 15px;
    color: rgba(255, 255, 255, .86);
}

.hero-points,
.hero-foot {
    display: none;
}

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-card {
    flex: 1;
    background: var(--surface);
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .14);
    animation: rise .45s ease both;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 600px) {
    .auth-hero {
        padding: 28px 40px 24px;
    }

    .hero-copy h2 {
        font-size: 32px;
    }

    .auth-main {
        align-items: center;
        padding: 0 24px 40px;
    }

    .auth-card {
        flex: none;
        width: 100%;
        max-width: 460px;
        padding: 32px;
        border-radius: var(--r-lg);
        box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    }
}

@media (min-width: 960px) {
    .auth-shell {
        flex-direction: row;
        align-items: center;
        gap: 56px;
        padding: 40px 48px;
    }

    .auth-hero {
        flex: 1;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 0;
    }

    .hero-copy {
        margin: auto 0;
        max-width: 480px;
    }

    .hero-tag {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 18px;
        padding: 6px 10px;
        font-size: 13px;
        font-weight: 600;
        color: #fff;
        background: rgba(255, 255, 255, .12);
        border: 1px solid rgba(255, 255, 255, .18);
        border-radius: var(--r-sm);
    }

    .hero-tag i {
        color: var(--gold);
    }

    .hero-copy h2 {
        font-size: 44px;
        margin-bottom: 14px;
    }

    .hero-copy p {
        font-size: 18px;
        margin-top: 0;
    }

    .hero-points {
        display: grid;
        gap: 14px;
        list-style: none;
        margin: 28px 0 0;
        padding: 0;
    }

    .hero-points li {
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 500;
    }

    .hero-points i {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        flex: none;
        border-radius: var(--r);
        background: rgba(255, 255, 255, .14);
        color: var(--gold);
    }

    .hero-foot {
        display: block;
        color: rgba(255, 255, 255, .65);
    }

    .auth-main {
        flex: none;
        width: 440px;
        padding: 0;
        align-items: stretch;
    }

    .auth-card {
        max-width: none;
        padding: 36px;
    }
}

/* ----- cadastro: painel largo (passos + formulário) ----- */
.reg {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.reg-side {
    padding: calc(20px + env(safe-area-inset-top)) 20px 24px;
    color: #fff;
}

.reg-side-copy {
    margin-top: 20px;
}

.reg-side-copy h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    line-height: 1.15;
}

.reg-side-copy p,
.reg-foot,
.steps {
    display: none;
}

.reg-main {
    flex: 1;
    background: var(--surface);
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .14);
    animation: rise .45s ease both;
}

.form-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.form-section::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.form-section:not(:first-of-type) {
    margin-top: 8px;
}

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

/* campos do cadastro: mais compactos */
.reg .field {
    margin-bottom: 14px;
}

.reg .field label:not(.check) {
    font-size: 13px;
    margin-bottom: 5px;
}

.reg .input {
    height: 46px;
}

.reg .input-wrap .input {
    padding-right: 46px;
}

.reg .toggle-pass {
    width: 46px;
    height: 46px;
}

.reg .phone-group {
    grid-template-columns: 124px 1fr;
    gap: 8px;
}

.reg select.input {
    padding-left: 10px;
    padding-right: 28px;
    background-position: right 10px center;
}

.reg .field-hint,
.reg .field-error {
    font-size: 12px;
    margin-top: 4px;
}

.reg .check {
    font-size: 13px;
}

.reg .btn {
    min-height: 46px;
}

.rules {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.rules li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    transition: background .2s, color .2s, border-color .2s;
}

.rules li i {
    font-size: 11px;
    opacity: .5;
}

.rules li.is-ok {
    color: var(--brand-link);
    background: var(--brand-50);
    border-color: var(--brand-100);
}

.rules li.is-ok i {
    opacity: 1;
}

.terms {
    margin-bottom: 14px;
}

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
}

.reg-main .auth-foot {
    margin-top: 16px;
    font-size: 14px;
}

@media (min-width: 600px) {
    .reg-side {
        padding: 28px 40px 24px;
    }

    .reg-side-copy h2 {
        font-size: 30px;
    }

    .reg-main {
        flex: none;
        align-self: center;
        width: calc(100% - 48px);
        max-width: 720px;
        margin-bottom: 40px;
        padding: 28px;
        border-radius: var(--r-lg);
        box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    }

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

@media (min-width: 900px) {
    .auth--wide {
        justify-content: center;
        padding: 24px;
    }

    .reg {
        flex: none;
        display: grid;
        grid-template-columns: 340px 1fr;
        max-width: 1020px;
        border-radius: var(--r-lg);
        overflow: hidden;
        box-shadow: 0 24px 60px rgba(0, 0, 0, .30);
    }

    .reg-side {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 32px 30px;
        background:
            linear-gradient(165deg, rgba(0, 50, 22, .86), rgba(0, 100, 40, .80)),
            url("../images/register-side.jpg") center / cover no-repeat,
            linear-gradient(165deg, #003216, #006428);
    }

    .reg-side-copy {
        margin: 24px 0;
    }

    .reg-side-copy h2 {
        font-size: 26px;
    }

    .reg-side-copy p {
        display: block;
        margin-top: 8px;
        font-size: 14px;
        color: rgba(255, 255, 255, .82);
    }

    .reg-foot {
        display: block;
        font-size: 13px;
        color: rgba(255, 255, 255, .6);
    }

    .steps {
        display: grid;
        margin: 24px 0 0;
        padding: 0;
        list-style: none;
        counter-reset: step;
    }

    .steps li {
        position: relative;
        display: flex;
        gap: 12px;
        padding-bottom: 18px;
    }

    .steps li:last-child {
        padding-bottom: 0;
    }

    .steps li::before {
        content: counter(step);
        counter-increment: step;
        flex: none;
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        border-radius: var(--r);
        background: rgba(255, 255, 255, .14);
        color: var(--gold);
        font-weight: 700;
        font-size: 13px;
    }

    .steps li:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 13px;
        top: 33px;
        bottom: 5px;
        width: 2px;
        background: rgba(255, 255, 255, .18);
    }

    .steps strong {
        display: block;
        font-size: 14px;
        font-weight: 600;
    }

    .steps span {
        font-size: 13px;
        color: rgba(255, 255, 255, .78);
    }

    .reg-main {
        width: auto;
        max-width: none;
        align-self: stretch;
        margin: 0;
        padding: 28px 36px;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    .reg-main .auth-title {
        font-size: 24px;
        margin-bottom: 2px;
    }

    .reg-main .auth-sub {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .reg .field {
        margin-bottom: 11px;
    }

    .reg .input {
        height: 42px;
    }

    .reg .input-wrap .input {
        padding-right: 42px;
    }

    .reg .toggle-pass {
        width: 42px;
        height: 42px;
    }

    .reg .phone-group {
        grid-template-columns: 116px 1fr;
    }

    .reg .form-section {
        margin-bottom: 10px;
    }

    .reg .rules {
        margin-bottom: 10px;
    }

    .reg .terms {
        margin-bottom: 12px;
    }

    .reg .btn {
        min-height: 44px;
        font-size: 15px;
    }

    .secure-note {
        margin-top: 10px;
    }

    .reg-main .auth-foot {
        margin-top: 12px;
    }
}

/* só em ecrãs com rato: letra dos campos mais pequena (em toque fica 16px para o iPhone não ampliar) */
@media (min-width: 900px) and (pointer: fine) {
    .reg .input {
        font-size: 14px;
    }

    .reg .btn {
        font-size: 14px;
    }
}

/* janelas baixas (portáteis pequenos): aperta ainda mais o espaço vertical */
@media (min-width: 900px) and (max-height: 760px) {
    .auth--wide {
        padding: 14px 24px;
    }

    .reg-side {
        padding: 24px 28px;
    }

    .reg-side-copy {
        margin: 14px 0;
    }

    .steps {
        margin-top: 16px;
    }

    .steps li {
        padding-bottom: 12px;
    }

    .reg-main {
        padding: 20px 32px;
    }

    .reg-main .auth-sub {
        margin-bottom: 10px;
    }

    .reg .field {
        margin-bottom: 9px;
    }

    .reg .field-hint {
        display: none;
    }
}

/* ---------- APP (área do cliente) ---------- */
.app {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-main {
    min-width: 0;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}

/* barra superior */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 16px 0;
    box-sizing: content-box;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar-logo img {
    height: 30px;
    width: auto;
}

.topbar-title {
    display: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--ink);
}

.user-menu-wrap {
    position: relative;
    margin-left: auto;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px;
    background: transparent;
    border: 0;
    border-radius: var(--r);
    cursor: pointer;
    color: var(--ink);
}

.user-btn:hover {
    background: var(--bg);
}

.user-btn-name,
.user-btn .fa-chevron-down {
    display: none;
    font-size: 14px;
    font-weight: 600;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r);
    background: var(--brand-50);
    color: var(--brand-link);
    font-weight: 700;
    font-size: 15px;
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    z-index: 30;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: 8px;
}

.user-menu.is-open {
    display: block;
}

.user-menu-head {
    display: grid;
    gap: 2px;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.user-menu-head strong {
    font-size: 15px;
    color: var(--ink);
}

.user-menu-head span {
    font-size: 13px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    background: transparent;
    border: 0;
    border-radius: var(--r);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg);
}

/* navegação: barra inferior no telemóvel */
.sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}

.sidebar-logo {
    display: none;
}

.sidebar-nav {
    display: flex;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: var(--bottom-nav-h);
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-item i {
    font-size: 19px;
}

.nav-item:hover {
    text-decoration: none;
}

.nav-item.is-active {
    color: var(--brand-link);
    box-shadow: inset 0 2px 0 var(--brand);
}

.nav-item.is-disabled {
    opacity: .45;
    cursor: default;
}

.soon {
    display: none;
    font-style: normal;
}

.app-content {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 22px 16px 32px;
}

.page-head {
    margin-bottom: 20px;
}

.page-head h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.15;
    color: var(--ink);
}

.eyebrow {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
}

.code {
    font-family: var(--font-mono);
    font-weight: 500;
    background: var(--brand-50);
    color: var(--brand-link);
    padding: 2px 6px;
    border-radius: var(--r-sm);
}

.code:empty {
    display: none;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.empty {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: var(--r-lg);
    background: var(--brand-50);
    color: var(--brand);
    font-size: 22px;
}

.empty h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 6px;
}

.notice {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--gold-soft);
    border: 1px solid #F1DC9A;
    border-radius: var(--r-lg);
    color: var(--gold-ink);
}

.notice>i {
    font-size: 18px;
}

.notice-text {
    flex: 1 1 200px;
    display: grid;
    gap: 2px;
    font-size: 14px;
}

.notice-text strong {
    color: #4F3A00;
}

.notice-text span {
    overflow-wrap: anywhere;
}

.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(2px);
}

@media (min-width: 900px) {
    .app {
        display: flex;
    }

    .app-main {
        flex: 1;
        padding-bottom: 0;
    }

    .sidebar {
        position: sticky;
        top: 0;
        left: auto;
        right: auto;
        bottom: auto;
        width: var(--sidebar-w);
        height: 100vh;
        height: 100dvh;
        flex: none;
        display: flex;
        flex-direction: column;
        padding: 20px 14px;
        border-top: 0;
        border-right: 1px solid var(--line);
    }

    .sidebar-logo {
        display: block;
        padding: 4px 10px 22px;
    }

    .sidebar-logo img {
        height: 34px;
        width: auto;
    }

    .sidebar-nav {
        flex-direction: column;
        gap: 4px;
    }

    .nav-item {
        flex: none;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        min-height: 44px;
        padding: 0 12px;
        border-radius: var(--r);
        font-size: 15px;
        box-shadow: none !important;
    }

    .nav-item i {
        width: 20px;
        text-align: center;
        font-size: 16px;
    }

    .nav-item:hover:not(.is-disabled) {
        background: var(--bg);
    }

    .nav-item.is-active {
        background: var(--brand-50);
    }

    .soon {
        display: inline;
        margin-left: auto;
        font-size: 11px;
        font-weight: 600;
        color: var(--muted);
        background: var(--bg);
        padding: 2px 6px;
        border-radius: var(--r-sm);
    }

    .topbar {
        padding-left: 32px;
        padding-right: 32px;
    }

    .topbar-logo {
        display: none;
    }

    .topbar-title {
        display: block;
    }

    .user-btn {
        padding: 4px 8px 4px 4px;
    }

    .user-btn-name,
    .user-btn .fa-chevron-down {
        display: inline;
    }

    .app-content {
        padding: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- REMESSAS ---------- */
.send-grid {
    display: grid;
    gap: 16px;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 20px;
    color: var(--ink);
    margin-bottom: 14px;
}

.card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-head .card-title {
    margin-bottom: 0;
}

.card+.card {
    margin-top: 0;
}

.send-grid .card,
#orderBox .card {
    margin-bottom: 0;
}

#orderBox {
    display: grid;
    gap: 14px;
}

.money-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-xl {
    height: 58px;
    font-size: 26px;
    font-weight: 700;
    font-family: var(--font-display);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    height: 42px;
    padding: 0 12px;
    font-weight: 700;
    font-size: 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.receive-box {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px;
    margin-bottom: 16px;
    background: var(--brand-50);
    border: 1px solid var(--brand-100);
    border-radius: var(--r-lg);
}

.receive-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.receive-box strong {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--brand-link);
}

.new-recipient {
    padding: 14px;
    margin-bottom: 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.choice {
    cursor: pointer;
}

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

.choice span {
    display: grid;
    gap: 2px;
    padding: 12px;
    text-align: center;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: var(--r);
    transition: border-color .15s, background .15s;
}

.choice small {
    font-size: 11px;
    color: var(--muted);
}

.choice input:checked+span {
    border-color: var(--brand);
    background: var(--brand-50);
}

.choice input:focus-visible+span {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.order-row:last-child {
    border-bottom: 0;
}

.order-row:hover {
    text-decoration: none;
    background: var(--bg);
}

.order-main,
.order-side {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.order-main small,
.order-side small {
    color: var(--muted);
    font-size: 12px;
}

.order-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-side {
    justify-items: end;
    text-align: right;
    flex: none;
}

.empty-inline {
    padding: 20px 0;
    text-align: center;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--r-sm);
}

.badge-ok {
    background: var(--success-bg);
    color: #0B5A27;
}

.badge-warn {
    background: var(--gold-soft);
    color: var(--gold-ink);
}

.badge-info {
    background: var(--info-bg);
    color: #1F4B7A;
}

.badge-muted {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--line);
}

.badge-danger {
    background: var(--danger-bg);
    color: #8F2424;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}

.order-head .order-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.order-amount {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 34px;
    color: var(--ink);
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
}

.kv:last-of-type {
    border-bottom: 0;
}

.kv span {
    color: var(--muted);
}

.kv strong {
    text-align: right;
    overflow-wrap: anywhere;
}

.pay-box {
    border-color: var(--brand-100);
}

.pay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.qr {
    display: block;
    width: 220px;
    max-width: 100%;
    margin: 14px auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.copy-code {
    height: auto;
    padding: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    resize: none;
}

.timer {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--brand-link);
}

.small {
    font-size: 13px;
    margin-top: 8px;
}

@media (min-width: 900px) {
    .send-grid {
        grid-template-columns: 440px 1fr;
        align-items: start;
        gap: 24px;
    }

    #orderBox {
        max-width: 640px;
    }
}

/* ---------- AJUSTE DE ESCALA + FONTE (Poppins) ---------- */
:root {
    --font-display: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --topbar-h: 54px;
    --sidebar-w: 216px;
    --bottom-nav-h: 58px;
}

body {
    font-size: 14px;
    line-height: 1.5;
}

.btn {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: var(--r);
}

.btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.input {
    height: 42px;
    font-size: 14px;
    padding: 0 12px;
}

.input-xl {
    height: 50px;
    font-size: 22px;
    font-weight: 700;
}

.field {
    margin-bottom: 14px;
}

.field label:not(.check) {
    font-size: 13px;
    margin-bottom: 5px;
}

.field-hint,
.field-error {
    font-size: 12px;
}

.alert {
    font-size: 13px;
    padding: 10px 12px;
}

.card {
    padding: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.page-head h1 {
    font-size: 22px;
    font-weight: 600;
}

.page-head .muted {
    font-size: 13px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
}

.auth-sub {
    font-size: 14px;
    margin-bottom: 20px;
}

.brand-copy h2 {
    font-size: 34px !important;
    font-weight: 700;
}

.brand-copy p {
    font-size: 16px !important;
}

.avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.topbar-logo img {
    height: 26px;
}

.nav-item {
    font-size: 10.5px;
}

.receive-box {
    padding: 12px;
    margin-bottom: 14px;
}

.receive-box strong {
    font-size: 22px;
    font-weight: 700;
}

.order-amount {
    font-size: 28px;
    font-weight: 700;
}

.kv {
    font-size: 13px;
    padding: 8px 0;
}

.pill {
    height: 36px;
    font-size: 13px;
}

.choice span {
    padding: 10px;
    font-size: 13px;
}

.order-row {
    padding: 10px 0;
    font-size: 13px;
}

.btn-dark {
    background: var(--ink);
    color: #fff;
    margin-bottom: 8px;
}

.btn-dark:hover {
    background: #000;
}

/* ---------- PASSOS ---------- */
.steps {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.steps li {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    font-size: 12px;
    color: var(--muted);
}

.steps li::before {
    content: '';
    position: absolute;
    top: 13px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--line);
    z-index: 0;
}

.steps li:first-child::before {
    display: none;
}

.steps li span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--line-strong);
    font-weight: 700;
    font-size: 12px;
}

.steps li em {
    font-style: normal;
    font-weight: 500;
}

.steps li.is-active {
    color: var(--ink);
    font-weight: 600;
}

.steps li.is-active span {
    border-color: var(--brand);
    color: var(--brand-link);
}

.steps li.is-done span {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.steps li.is-done::before,
.steps li.is-active::before {
    background: var(--brand);
}

.steps-track {
    margin: 16px 0 0;
}

.wiz-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.wiz-actions .btn-primary {
    flex: 1;
}

.wiz-actions .btn-outline {
    flex: none;
}

.rec-list {
    display: grid;
    gap: 8px;
}

.rec-item {
    display: block;
    cursor: pointer;
}

.rec-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rec-item>span {
    display: grid;
    gap: 1px;
    padding: 10px 12px;
    background: #fff;
    border: 2px solid var(--line);
    border-radius: var(--r);
    transition: border-color .15s, background .15s;
}

.rec-item small {
    color: var(--muted);
    font-size: 12px;
}

.rec-item input:checked+span {
    border-color: var(--brand);
    background: var(--brand-50);
}

.rec-item input:focus-visible+span {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.new-recipient {
    padding: 12px;
    margin-bottom: 14px;
}

.review {
    margin-bottom: 14px;
    padding: 4px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
}

.kv-big strong {
    font-size: 16px;
    color: var(--brand-link);
}

.test-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    font-size: 12.5px;
    font-weight: 500;
    background: var(--gold-soft);
    border: 1px solid #F1DC9A;
    color: var(--gold-ink);
    border-radius: var(--r);
}

.test-panel {
    border-style: dashed;
    border-color: #E0B93A;
    background: #FFFDF3;
}

/* ---------- PIX / PEDIDO ---------- */
.pay-lead {
    text-align: center;
    font-weight: 600;
    color: var(--ink);
}

.qr-holder {
    display: flex;
    justify-content: center;
    margin: 12px 0;
}

.qr-draw {
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
}

.qr {
    width: 190px;
    margin: 0;
}

.center {
    text-align: center;
}

.copy-code {
    font-size: 11px;
    margin: 6px 0 10px;
}

.how-title {
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.how {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 12.5px;
    color: var(--muted);
}

.timer {
    text-align: center;
    margin: 12px 0 0;
    font-size: 13px;
}

.done-card {
    text-align: center;
    padding: 24px 16px;
}

.done-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: var(--brand-50);
    color: var(--brand);
    font-size: 22px;
    font-weight: 700;
}

.done-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}

/* ---------- PRELOADER: loader() / closeloader() ---------- */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}

.loader-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.loader-box {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 22px 26px;
    text-align: center;
}

.loader-ring {
    width: 38px;
    height: 38px;
    border: 4px solid var(--brand-100);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}

.loader-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

@media (min-width: 900px) {
    .send-grid {
        grid-template-columns: 400px 1fr;
        gap: 20px;
    }
}

/* ---------- ENVIO EM CURSO ---------- */
.processing-card {
    text-align: center;
    padding: 24px 16px;
}

.processing-ring {
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    border: 4px solid var(--brand-100);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.proc-steps {
    list-style: none;
    margin: 16px auto 12px;
    padding: 0;
    max-width: 280px;
    display: grid;
    gap: 10px;
    text-align: left;
    font-size: 13px;
    color: var(--muted);
}

.proc-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.proc-dot {
    flex: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: #fff;
}

.proc-steps li.is-done {
    color: var(--ink);
}

.proc-steps li.is-done .proc-dot {
    background: var(--brand);
    border-color: var(--brand);
}

.proc-steps li.is-active {
    color: var(--ink);
    font-weight: 600;
}

.proc-steps li.is-active .proc-dot {
    border-color: var(--brand);
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 156, 59, .45);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(0, 156, 59, 0);
    }
}

/* ---------- LOGIN: logo branco sem fundo + checks ---------- */
.brand-chip {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.brand-chip img {
    height: 44px;
    width: auto;
    border-radius: 10px;
}

.hero-points i {
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
    color: var(--gold);
    font-size: 17px;
}