:root {
    color-scheme: light;
    --ink: #112522;
    --muted: #63736f;
    --line: #dce7e4;
    --primary: #0da57e;
    --primary-dark: #08755d;
    --surface: #ffffff;
    --soft: #eff8f5;
    --danger: #c73c4d;
    --shadow: 0 24px 80px rgba(2, 32, 25, .18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #071d1a; }
body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.landing-page {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 13% 18%, rgba(22, 198, 151, .22), transparent 27rem),
        radial-gradient(circle at 88% 82%, rgba(65, 185, 255, .13), transparent 28rem),
        linear-gradient(135deg, #061714 0%, #0a2924 52%, #071c1a 100%);
}
.landing-page::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .12;
    pointer-events: none;
    background-image: radial-gradient(rgba(255,255,255,.8) .7px, transparent .7px);
    background-size: 20px 20px;
    mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.landing-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .7fr);
    align-items: center;
    gap: clamp(48px, 9vw, 130px);
    padding: 48px 0;
}
.landing-copy { color: #fff; min-width: 0; }
.brand {
    position: absolute;
    top: 42px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-size: 1.18rem;
    letter-spacing: -.02em;
}
.brand-mark {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 15px 15px 15px 5px;
    background: linear-gradient(145deg, #25d9a8, #07986f);
    box-shadow: 0 10px 25px rgba(10, 218, 157, .25), inset 0 1px rgba(255,255,255,.4);
}
.brand-mark::before {
    content: "";
    width: 19px;
    height: 14px;
    border: 2px solid white;
    border-radius: 10px;
}
.brand-mark::after {
    content: "";
    position: absolute;
    left: 12px;
    bottom: 10px;
    width: 7px;
    height: 7px;
    border-left: 2px solid #fff;
    transform: rotate(-24deg);
}
.brand-mark span,
.mini-logo {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 6px 0 #fff, -6px 0 #fff;
}
.hero { max-width: 720px; }
.eyebrow {
    margin: 0 0 14px;
    color: #45dcb5;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0;
    font-size: clamp(3rem, 6.2vw, 5.8rem);
    line-height: .97;
    letter-spacing: -.07em;
    text-wrap: balance;
}
.hero h1 span { color: #75e3c6; }
.hero-text {
    max-width: 610px;
    margin: 28px 0 0;
    color: rgba(255,255,255,.7);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.7;
}
.trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-top: 46px;
    padding: 0;
    list-style: none;
    color: rgba(255,255,255,.6);
    font-size: .78rem;
}
.trust-row li::first-letter { color: #23d6a5; }

.welcome-card, .install-card {
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 34px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}
.welcome-card {
    padding: clamp(32px, 5vw, 52px);
    text-align: center;
}
.welcome-card .eyebrow, .install-card .eyebrow { color: var(--primary-dark); }
.welcome-card h2, .install-card h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    letter-spacing: -.045em;
}
.welcome-card > p:not(.eyebrow), .install-card > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}
.referral-welcome {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 7px;
    margin-top: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(7,150,111,.24);
    border-radius: 13px;
    color: #28443d;
    background: #edf9f5;
    font-size: .72rem;
}
.referral-welcome strong { color: var(--primary-dark); }
.referral-welcome span { padding: 3px 7px; border-radius: 999px; color: var(--primary-dark); background: rgba(7,150,111,.1); font-size: .64rem; font-weight: 800; }
.shared-contact-welcome { margin-top: 7px; border-style: dashed; }
.welcome-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 108px;
    height: 108px;
    margin: 0 auto 30px;
}
.pulse {
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(13, 165, 126, .2);
    border-radius: 50%;
    animation: pulse 3s ease-out infinite;
}
.pulse.two { animation-delay: 1.5s; }
@keyframes pulse { 0% { transform: scale(.72); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.chat-glyph {
    position: relative;
    z-index: 1;
    width: 74px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 26px 26px 26px 9px;
    background: linear-gradient(145deg, #25d7a5, #07966f);
    box-shadow: 0 18px 35px rgba(7, 150, 111, .25);
}
.chat-glyph::after {
    content: "";
    position: absolute;
    left: 7px;
    bottom: -7px;
    width: 19px;
    height: 19px;
    background: #07966f;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.chat-glyph i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: dots 1.4s ease-in-out infinite;
}
.chat-glyph i:nth-child(2) { animation-delay: .15s; }
.chat-glyph i:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 60%, 100% { transform: translateY(0); opacity: .7; } 30% { transform: translateY(-6px); opacity: 1; } }
.welcome-actions { display: grid; gap: 12px; margin: 30px 0 20px; }
.welcome-card small, .install-card small { color: #899692; line-height: 1.5; }

.button {
    min-height: 54px;
    border: 0;
    border-radius: 17px;
    padding: 0 24px;
    font-weight: 800;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: .6; }
.button.primary {
    color: #fff;
    background: linear-gradient(135deg, #13b98d, #08785e);
    box-shadow: 0 12px 28px rgba(8, 120, 94, .2);
}
.button.primary:hover { box-shadow: 0 16px 32px rgba(8, 120, 94, .3); }
.button.secondary { color: var(--primary-dark); background: var(--soft); border: 1px solid #cce9e1; }
.wide { width: 100%; }
.offline-retry { display: grid; place-items: center; text-decoration: none; }
.text-button {
    border: 0;
    padding: 10px;
    color: var(--primary-dark);
    font-weight: 750;
    background: transparent;
}
.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--soft);
    color: var(--ink);
    font-size: 1.4rem;
}

.auth-dialog {
    width: min(480px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    max-height: calc(100svh - 28px);
    padding: clamp(28px, 5vw, 46px);
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 30px;
    color: var(--ink);
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow);
}
.auth-dialog::backdrop { background: rgba(2, 18, 15, .74); backdrop-filter: blur(12px); }
.dialog-close { position: absolute; top: 18px; right: 18px; }
.auth-head { padding-right: 40px; margin-bottom: 26px; }
.auth-head h2 { margin: 0 0 8px; font-size: 2rem; letter-spacing: -.045em; }
.auth-head p:not(.eyebrow) { margin: 0; color: var(--muted); }
.mini-logo {
    position: relative;
    display: block;
    width: 38px;
    height: 38px;
    margin-bottom: 28px;
    border-radius: 13px 13px 13px 5px;
    background: var(--primary);
}
.auth-form { display: grid; gap: 18px; }
.auth-form[hidden] { display: none; }
.field { display: grid; gap: 8px; text-align: left; }
.field > span, .field > label { color: #394c47; font-size: .82rem; font-weight: 750; }
.field small { color: #81908c; }
.field input {
    width: 100%;
    height: 52px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 15px;
    outline: none;
    color: var(--ink);
    background: #fff;
    transition: border .18s, box-shadow .18s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13, 165, 126, .12); }
.input-with-prefix, .password-wrap { position: relative; }
.input-with-prefix b {
    position: absolute;
    left: 15px;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    color: var(--primary-dark);
}
.input-with-prefix input { padding-left: 33px; }
.password-wrap button {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    color: #71817d;
    background: transparent;
}
.password-wrap input { padding-right: 48px; }
.check-row { display: flex; align-items: center; gap: 10px; color: #4b5e59; font-size: .88rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.legal-check { align-items: flex-start; line-height: 1.45; }
.legal-check a { color: var(--primary-dark); }
.landing-footer { position: fixed; z-index: 2; left: 50%; bottom: 15px; display: flex; align-items: center; gap: 14px; transform: translateX(-50%); color: rgba(255,255,255,.48); font-size: .66rem; }
.landing-footer a { color: inherit; text-decoration: none; }
.landing-footer a:hover { color: #fff; }
.alert { padding: 12px 14px; border-radius: 13px; margin: 12px 0; font-size: .87rem; line-height: 1.45; }
.alert.error { color: #842638; background: #fff0f2; border: 1px solid #f5c9d0; }
.alert.success { color: #12634f; background: #eafaf5; border: 1px solid #c5eee1; }

.install-page {
    display: grid;
    place-items: center;
    padding: 30px 16px;
    background: linear-gradient(135deg, #061714, #0b352e);
}
.install-card { width: min(720px, 100%); padding: clamp(28px, 5vw, 52px); }
.install-card > .brand-mark { margin-bottom: 26px; }
.install-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0 18px;
}
.full { grid-column: 1 / -1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
code { padding: 2px 6px; border-radius: 5px; background: #e8f1ef; }
.legal-page { min-height: 100vh; padding: 28px 16px 70px; background: #edf3f1; }
.legal-shell { width: min(830px, 100%); margin: 0 auto; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.legal-top .brand { position: static; color: var(--ink); }
.legal-back { color: var(--primary-dark); text-decoration: none; font-size: .78rem; font-weight: 800; }
.legal-card { padding: clamp(25px, 6vw, 58px); border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 20px 65px rgba(22,54,46,.1); }
.legal-card h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1; letter-spacing: -.06em; }
.legal-card .legal-date { margin: 13px 0 30px; color: var(--muted); font-size: .76rem; }
.legal-card h2 { margin: 30px 0 9px; font-size: 1.05rem; letter-spacing: -.02em; }
.legal-card p, .legal-card li { color: #4e625c; font-size: .88rem; line-height: 1.75; }
.legal-card ul { padding-left: 20px; }
.legal-card a { color: var(--primary-dark); }
.legal-note { padding: 13px 15px; border: 1px solid #c5ebe1; border-radius: 13px; color: var(--primary-dark) !important; background: #edfaf6; }

@media (max-width: 820px) {
    .landing-shell {
        width: min(100% - 28px, 560px);
        grid-template-columns: 1fr;
        gap: 44px;
        padding: 100px 0 24px;
    }
    .brand { top: 26px; }
    .hero h1 { font-size: clamp(2.8rem, 14vw, 4.6rem); }
    .hero-text { margin-top: 20px; }
    .trust-row { margin-top: 28px; }
    .welcome-card { border-radius: 28px; }
    .landing-footer { position: relative; left: auto; bottom: auto; justify-content: center; transform: none; padding: 6px 0 18px; }
}
@media (max-width: 560px) {
    .install-form { grid-template-columns: 1fr; }
    .full { grid-column: auto; }
    .landing-shell { width: min(100% - 20px, 520px); }
    .welcome-card { padding: 30px 22px; }
    .auth-dialog { padding: 30px 22px 24px; border-radius: 24px; }
}
.site-logo, .brand-mark.logo-image {
    display: block;
    flex: 0 0 auto;
    border-radius: 50%;
    background-color: var(--primary);
    background-image: url("../../imagens/logo_falatudo.png?v=3.0.0"), linear-gradient(145deg, #25d7a5, #07966f);
    background-position: center;
    background-size: cover;
    box-shadow: 0 12px 30px rgba(7,150,111,.28);
}
.landing-logo { width: 50px; height: 50px; border: 2px solid rgba(255,255,255,.24); }
.welcome-logo { position: relative; z-index: 2; width: 88px; height: 88px; border: 4px solid rgba(255,255,255,.78); }
.brand-mark.logo-image { width: 64px; height: 64px; margin-bottom: 26px; }
.dialog-close { width: 50px; height: 50px; font-size: 1.6rem; }
#usernameFeedback.available { color: #08755d; font-weight: 800; }
#usernameFeedback.unavailable { color: var(--danger); font-weight: 800; }
#usernameFeedback.checking { color: #54706a; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 1.5.1 — entrada responsiva e interações táteis */
html,
body { max-width: 100%; overflow-x: clip; }
:where(button, a, input) { touch-action: manipulation; }
:where(button, a, input):focus-visible {
    outline: 3px solid rgba(13, 165, 126, .34);
    outline-offset: 3px;
}
.tap-feedback { animation: landing-tap .28s ease-out; }
@keyframes landing-tap {
    0% { transform: scale(1); }
    42% { transform: scale(.95); }
    100% { transform: scale(1); }
}
.button.primary {
    background-size: 180% 180%;
    animation: landing-button-glow 7s ease infinite;
}
@keyframes landing-button-glow {
    0%, 100% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 820px) {
    .landing-page {
        min-width: 0;
        overflow-x: hidden;
    }
    .landing-shell {
        width: min(calc(100vw - 24px), 560px);
        max-width: 100%;
        padding-top: 88px;
    }
    .landing-copy,
    .hero,
    .welcome-card { min-width: 0; max-width: 100%; }
    .brand {
        right: 12px;
        left: 12px;
    }
    .hero h1 {
        overflow-wrap: anywhere;
        font-size: clamp(2.5rem, 13vw, 4.4rem);
    }
    .trust-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .auth-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        margin: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .auth-form,
    .auth-form > *,
    .field,
    .field input { min-width: 0; max-width: 100%; }
}

@media (max-width: 480px) {
    .landing-shell {
        width: calc(100vw - 16px);
        gap: 28px;
        padding-top: 78px;
    }
    .landing-logo {
        width: 44px;
        height: 44px;
    }
    .brand strong { font-size: .92rem; }
    .hero h1 { font-size: clamp(2.25rem, 12vw, 3.45rem); }
    .hero-text { font-size: .92rem; }
    .welcome-card { padding: 26px 17px; border-radius: 23px; }
    .auth-dialog {
        padding: 27px 17px 22px;
        border-radius: 21px;
    }
    .auth-head {
        padding-right: 45px;
        margin-bottom: 20px;
    }
    .auth-head h2 { font-size: 1.7rem; }
    .dialog-close {
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
    }
    .landing-footer {
        flex-wrap: wrap;
        row-gap: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button.primary,
    .tap-feedback { animation: none; }
}
/* FalaTudo 1.6.0 — convite de instalação inteligente */
.landing-install-notice {
    position: fixed;
    z-index: 80;
    right: 22px;
    bottom: 22px;
    width: min(500px, calc(100% - 28px));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid rgba(21,168,132,.35);
    border-radius: 19px;
    color: #f8fafc;
    background: rgba(7,29,26,.94);
    box-shadow: 0 22px 65px rgba(0,0,0,.32);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}
.landing-install-notice.visible { opacity: 1; transform: none; }
.landing-install-notice.update-ready { border-color: rgba(167,139,250,.62); }
.landing-install-notice > span { width: 50px; height: 50px; overflow: hidden; border-radius: 15px; background: #15a884; }
.landing-install-notice img { width: 100%; height: 100%; object-fit: cover; }
.landing-install-notice strong { display: block; margin-bottom: 3px; font-size: .8rem; }
.landing-install-notice p { margin: 0; color: #a8b8b4; font-size: .65rem; line-height: 1.4; }
.landing-install-notice button { min-height: 40px; padding: 0 13px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#15a884,#7c3aed); font-size: .65rem; font-weight: 850; }
.landing-install-notice button:last-child { width: 31px; min-height: 31px; padding: 0; color: #a8b8b4; background: rgba(255,255,255,.08); font-size: 1rem; }
@media (max-width: 620px) {
    .landing-install-notice { right: 10px; bottom: 10px; width: calc(100% - 20px); grid-template-columns: auto minmax(0,1fr) auto; }
    .landing-install-notice > div { padding-right: 25px; }
    .landing-install-notice button:nth-last-child(2) { grid-column: 2 / 3; width: 100%; }
    .landing-install-notice button:last-child { position: absolute; top: 7px; right: 7px; }
}
