/* ============================================================
   DietPrime — NutriFinder
   Busca à esquerda + mapa à direita. Visual da home e do login.
   ============================================================ */
.nf {
    --nf-g: #0a8f55; --nf-g2: #00754a; --nf-ink: #0c2a20; --nf-muted: #5d6e69;
    --nf-mint: #f0faf5; --nf-line: #e4ece8; --nf-dark: #03291f;
    color: var(--nf-ink);
}
.nf h1, .nf h2, .nf h3, .nf p { margin: 0; }

/* Menu na largura toda, como a busca e o mapa logo abaixo */
.pnav .container { max-width: none; padding-left: 1.25rem; padding-right: 1.25rem; }

/* ---------- Área principal ---------- */
.nf-app {
    --nf-top: 72px;
    display: grid;
    grid-template-columns: minmax(340px, 20%) minmax(0, 1fr);
    height: calc(100vh - var(--nf-top));
    height: calc(100dvh - var(--nf-top));
    min-height: 620px;
}
.nf-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border-right: 1px solid var(--nf-line);
    box-shadow: 8px 0 30px rgba(12,48,32,.06);
    position: relative;
    z-index: 2;
}
.nf-side__scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.nf-side__head {
    position: relative;
    padding: 1.4rem 1.25rem 1.3rem;
    background: linear-gradient(145deg, #047857 0%, #059669 45%, #10b981 100%);
    color: #fff;
}
.nf-side__head::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .5;
    pointer-events: none;
}
.nf-side__head > * { position: relative; }
.nf-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .7rem;
    border-radius: 999px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: #d1fae5;
}
.nf-side__head h1 { margin-top: .7rem; font-size: 1.4rem; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; color: #fff; }
.nf-side__head p { margin-top: .4rem; font-size: .82rem; font-weight: 500; color: #d1fae5; }
.is-searched .nf-side__head { padding: 1rem 1.25rem; }
.is-searched .nf-side__head h1 { margin-top: .5rem; font-size: 1.05rem; }
.is-searched .nf-side__head p { display: none; }

/* ---------- Filtros ---------- */
.nf-filters { border-bottom: 1px solid var(--nf-line); }
.nf-filters > summary { display: none; }
.is-searched .nf-filters > summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .8rem 1.25rem;
    list-style: none;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 700;
    color: var(--nf-g2);
}
.is-searched .nf-filters > summary::-webkit-details-marker { display: none; }
.nf-filters > summary small { display: block; font-size: .72rem; font-weight: 500; color: var(--nf-muted); }
.nf-form { display: flex; flex-direction: column; gap: 1rem; padding: 1.2rem 1.25rem 1.25rem; }
.is-searched .nf-form { padding-top: .2rem; }
.nf-field { display: flex; flex-direction: column; min-width: 0; }
.nf-field > label {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .4rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #334155;
}
.nf-field > label b { font-size: .78rem; letter-spacing: 0; text-transform: none; color: var(--nf-g2); }
.nf-field input[type="text"],
.nf-field input[type="email"],
.nf-field input[type="password"],
.nf-field input[type="tel"],
.nf-field select {
    width: 100%;
    padding: .72rem .95rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    color: #1e293b;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.nf-field input::placeholder { font-weight: 500; color: #94a3b8; }
.nf-field input:focus,
.nf-field select:focus {
    outline: none;
    background: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16,185,129,.2);
}
.nf-field input[type="range"] { width: 100%; accent-color: var(--nf-g); cursor: pointer; }
.nf-input { position: relative; }
.nf-input > svg { position: absolute; top: 50%; left: .95rem; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.nf-field .nf-input input { padding-left: 2.55rem; }
.nf-loc { display: flex; flex-direction: column; gap: .5rem; }
.nf-loc[hidden], .nf-chip[hidden] { display: none; }
.nf-chip {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .62rem .75rem;
    background: var(--nf-mint);
    border: 1px solid #cdeedd;
    border-radius: 16px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--nf-g2);
}
.nf-chip span { flex: 1; }
.nf-chip button { display: flex; padding: .2rem; background: none; border: 0; border-radius: 6px; cursor: pointer; color: var(--nf-muted); }
.nf-chip button:hover { background: #dff3e8; color: var(--nf-ink); }
.nf-check { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 500; color: var(--nf-muted); cursor: pointer; }
.nf-check input { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--nf-g); }

.nf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .78rem 1rem;
    border: 0;
    border-radius: 16px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .15s;
}
.nf-btn:hover { text-decoration: none; }
.nf-btn:disabled { opacity: .65; cursor: progress; }
.nf-btn--primary { background: #059669; color: #fff; box-shadow: 0 10px 15px -3px rgba(5,150,105,.25); }
.nf-btn--primary:hover { background: #047857; color: #fff; }
.nf-btn--soft { background: var(--nf-mint); color: var(--nf-g2); box-shadow: inset 0 0 0 1px #cdeedd; }
.nf-btn--soft:hover { background: #e3f5eb; color: var(--nf-g2); }
.nf-btn--white { margin-top: 1.1rem; background: #fff; color: var(--nf-g2); padding: .85rem 1.3rem; }
.nf-btn--white:hover { background: #ecfdf5; color: var(--nf-g2); }
.nf-btn--sm { flex: 1; padding: .52rem .6rem; border-radius: 12px; font-size: .76rem; box-shadow: none; }
.nf-btn--sm.nf-btn--soft { box-shadow: inset 0 0 0 1px #cdeedd; }

.nf-status { font-size: .8rem; }
.nf-status:empty { display: none; }
.nf-status.is-loading, .nf-status.is-error { display: flex; align-items: center; gap: .55rem; padding: .6rem .75rem; border-radius: 12px; font-weight: 600; }
.nf-status.is-loading { background: var(--nf-mint); color: var(--nf-g2); }
.nf-status.is-error { background: #fdecea; color: #b3261e; }
.nf-spin { width: 16px; height: 16px; flex-shrink: 0; border: 2.5px solid #bfe6d2; border-top-color: var(--nf-g); border-radius: 50%; animation: nfSpin .7s linear infinite; }
@keyframes nfSpin { to { transform: rotate(360deg); } }

/* ---------- Resultados ---------- */
.nf-results { padding: .9rem .9rem 1.1rem; background: #f8fbfa; }
.nf-count { margin: 0 .3rem .7rem !important; font-size: .78rem; color: var(--nf-muted); }
.nf-count b { color: var(--nf-ink); }
.nf-card {
    margin-bottom: .6rem;
    padding: .8rem;
    background: #fff;
    border: 1px solid var(--nf-line);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(12,48,32,.05);
    transition: border-color .15s, box-shadow .15s;
}
.nf-card:last-child { margin-bottom: 0; }
.nf-card--pin { cursor: pointer; }
.nf-card--pin:hover, .nf-card--pin:focus-visible { outline: none; border-color: #34d399; box-shadow: 0 8px 22px rgba(12,48,32,.1); }
.nf-card__top { display: flex; gap: .65rem; }
.nf-card__avatar { flex: 0 0 44px; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; overflow: hidden; border-radius: 50%; background: #e1f3ea; }
.nf-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.nf-card__avatar span { font-size: 1.05rem; font-weight: 800; color: #1b7a4c; }
.nf-card__body { flex: 1; min-width: 0; }
.nf-card h3 { font-size: .9rem; font-weight: 700; line-height: 1.25; }
.nf-card h3 a { color: var(--nf-ink); text-decoration: none; }
.nf-card h3 a:hover { color: var(--nf-g2); }
.nf-card__spec { margin-top: .1rem !important; font-size: .76rem; font-weight: 600; color: #1b7a4c; }
.nf-card__city { display: flex; align-items: center; gap: .25rem; margin-top: .15rem !important; font-size: .74rem; color: var(--nf-muted); }
.nf-card__tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .55rem !important; }
.nf-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; background: #eef2f0; font-size: .68rem; font-weight: 600; color: #475569; }
.nf-tag--dist { background: #059669; color: #fff; }
.nf-card__actions { display: flex; gap: .4rem; margin-top: .65rem; }
.nf-empty { padding: 1.4rem 1rem; text-align: center; background: #fff; border: 1px solid var(--nf-line); border-radius: 16px; font-size: .85rem; }
.nf-empty p { margin-top: .35rem !important; font-size: .8rem; color: var(--nf-muted); }

.nf-side__foot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .3rem .45rem;
    padding: .75rem 1rem;
    background: #fff;
    border-top: 1px solid var(--nf-line);
    font-size: .78rem;
    font-weight: 600;
    color: var(--nf-muted);
}
.nf-side__foot button, .nf-side__foot a {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: 0;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 700;
    color: #059669;
    cursor: pointer;
}

/* ---------- Mapa ---------- */
.nf-mapbox { position: relative; min-width: 0; overflow: hidden; isolation: isolate; background: #dfeee6; }
#nf-map { position: absolute; inset: 0; z-index: 1; transition: filter .7s ease, opacity .7s ease, transform .7s ease; }
#nf-map.is-blurred { filter: blur(5px) saturate(.75); opacity: .65; transform: scale(1.03); pointer-events: none; }
.nf-mapnote {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: min(360px, calc(100% - 2rem));
    padding: 1.6rem 1.5rem;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255,255,255,.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(10,40,28,.18);
}
.nf-mapnote__ic { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: .75rem; border-radius: 50%; background: #e1f3ea; color: var(--nf-g2); }
.nf-mapnote h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--nf-ink); }
.nf-mapnote p { margin-top: .35rem; font-size: .88rem; color: var(--nf-muted); }
.nf-mapflag {
    position: absolute;
    top: 1rem;
    left: 50%;
    z-index: 3;
    width: max-content;
    max-width: calc(100% - 2rem);
    padding: .55rem 1rem;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(12,48,32,.14);
    font-size: .8rem;
    font-weight: 600;
    color: var(--nf-muted);
}
.nf-pin span {
    display: block;
    width: 28px;
    height: 28px;
    background: linear-gradient(145deg, #10b981, #047857);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 6px 14px rgba(4,120,87,.4);
}
.nf-pop { display: flex; flex-direction: column; gap: .1rem; font-family: Inter, system-ui, sans-serif; }
.nf-pop strong { font-size: .88rem; color: var(--nf-ink, #0c2a20); }
.nf-pop span { font-size: .76rem; color: #5d6e69; }
.nf-pop a { margin-top: .35rem; font-size: .78rem; font-weight: 700; color: #059669; }

/* ---------- Abaixo do mapa ---------- */
.nf-more { display: grid; gap: 2.5rem; max-width: 1040px; margin: 0 auto; padding: 3.5rem 1.5rem 4rem; }
.nf-more h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--nf-ink); }
.nf-steps > h2, .nf-faq > h2 { margin-bottom: 1.2rem; text-align: center; }
.nf-steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.nf-steps li { padding: 1.3rem; background: #fff; border: 1px solid var(--nf-line); border-radius: 20px; box-shadow: 0 2px 10px rgba(12,48,32,.06); }
.nf-steps span { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-bottom: .7rem; border-radius: 50%; background: #e1f3ea; font-size: .85rem; font-weight: 800; color: #1b7a4c; }
.nf-steps b { display: block; font-size: 1rem; }
.nf-steps p { margin-top: .25rem; font-size: .88rem; color: var(--nf-muted); }
.nf-join {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.4rem;
    background: linear-gradient(145deg, var(--nf-dark), #011a14);
    border-radius: 28px;
    box-shadow: 0 30px 70px rgba(10,40,28,.18);
}
.nf-join .nf-pill { margin-bottom: .75rem; }
.nf .nf-join h2 { color: #fff; }
.nf-join ul { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.nf-join li { display: flex; gap: .55rem; font-size: .9rem; line-height: 1.4; color: rgba(255,255,255,.85); }
.nf-join li svg { flex-shrink: 0; margin-top: .1rem; color: #6ee7b7; }

.nf-dir > h2 { margin-bottom: 1.2rem; text-align: center; }
.nf-dir ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.nf-dir a { display: block; padding: .6rem .85rem; background: #fff; border: 1px solid var(--nf-line); border-radius: 12px; font-size: .84rem; color: var(--nf-ink); text-decoration: none; transition: border-color .15s; }
.nf-dir a:hover { border-color: #34d399; }
.nf-dir b { display: block; font-weight: 600; }
.nf-dir span { font-size: .74rem; color: var(--nf-muted); }

/* ---------- Modal de cadastro ---------- */
.nf-modal { position: fixed; inset: 0; z-index: 2000; display: none; color: #0c2a20; }
.nf-modal.is-open { display: block; }
.nf-modal__backdrop { position: absolute; inset: 0; background: rgba(12,22,16,.55); backdrop-filter: blur(2px); }
.nf-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(680px, calc(100% - 2rem));
    max-height: 92vh;
    overflow-y: auto;
    margin: 4vh auto;
    padding: 1.8rem 1.8rem 1.6rem;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(10,40,28,.3);
    animation: nfModalIn .25s ease;
}
@keyframes nfModalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.nf-modal__close { position: absolute; top: .8rem; right: 1rem; padding: .1rem .4rem; background: none; border: 0; border-radius: 8px; font-size: 1.7rem; line-height: 1; color: #5d6e69; cursor: pointer; }
.nf-modal__close:hover { background: #f0faf5; color: #0c2a20; }
.nf-modal__head { margin-bottom: 1.2rem; text-align: center; }
.nf-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; background: #e1f3ea; font-size: .72rem; font-weight: 700; color: #1b7a4c; }
.nf-modal__head h2 { margin: .5rem 0 .25rem; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.nf-modal__head p { margin: 0; font-size: .88rem; color: #5d6e69; }
.nf-modal__errors { margin-bottom: 1rem; padding: .7rem .9rem; background: #fdecea; border: 1px solid #f7c9c6; border-radius: 12px; font-size: .85rem; color: #b3261e; }
.nf-modal__errors ul { margin: 0; padding-left: 1.1rem; }
.nf-modal__row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: .9rem; }
.nf-modal__form .nf-field { flex: 1 1 150px; }
.nf-modal__form .nf-field--uf { flex: 0 0 90px; }
.nf-modal .req { color: #e5484d; }
.nf-modal__check { align-items: flex-start; margin: .2rem 0 .9rem; font-size: .85rem; }
.nf-modal__check a { font-weight: 600; color: #047857; text-decoration: underline; }
.nf-modal__form .btn-block { border-radius: 16px; background: #059669; }
.nf-modal__form .btn-block:hover { background: #047857; }
.nf-modal__foot { margin: .9rem 0 0; text-align: center; font-size: .85rem; color: #5d6e69; }
.nf-modal__foot a { font-weight: 600; color: #047857; }

/* ---------- Modal "Ver perfil" ---------- */
.nf-modal__dialog.nf-prof { width: min(560px, calc(100% - 2rem)); }
.nf-prof__head { display: flex; align-items: center; gap: 1rem; padding-right: 2rem; }
.nf-prof__avatar { flex: 0 0 76px; display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; overflow: hidden; border-radius: 50%; background: #e1f3ea; }
.nf-prof__avatar img { width: 100%; height: 100%; object-fit: cover; }
.nf-prof__avatar span { font-size: 1.7rem; font-weight: 800; color: #1b7a4c; }
.nf-prof h2 { margin: 0; font-size: 1.3rem; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; color: #0c2a20; }
.nf-prof__spec { margin: .2rem 0 0; font-size: .88rem; font-weight: 600; color: #1b7a4c; }
.nf-prof__tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 0; }
.nf-prof__bio { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e4ece8; font-size: .9rem; line-height: 1.65; color: #475569; overflow-wrap: anywhere; }
.nf-prof__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.nf-prof__actions .nf-btn { flex: 1 1 190px; white-space: nowrap; }
.nf-prof__page { display: flex; align-items: center; justify-content: center; gap: .25rem; margin-top: 1rem; font-size: .8rem; font-weight: 700; color: #059669; }

/* ---------- Celular e tablet ---------- */
@media (max-width: 900px) {
    .nf-app { display: flex; flex-direction: column; height: auto; min-height: 0; }
    .nf-side { border-right: 0; box-shadow: none; }
    .nf-side__scroll { overflow: visible; }
    .nf-mapbox { height: 260px; }
    /* Depois da busca o mapa vem primeiro, com os resultados logo abaixo */
    .nf-app.is-searched .nf-mapbox { order: -1; height: 46vh; min-height: 300px; }
    .nf-mapnote { padding: 1.1rem; border-radius: 18px; }
    .nf-mapnote__ic { display: none; }
    /* 16px evita o zoom automático do iPhone ao focar o campo */
    .nf-field input[type="text"], .nf-field input[type="email"], .nf-field input[type="password"],
    .nf-field input[type="tel"], .nf-field select { font-size: 16px; }
    .nf-more { gap: 2rem; padding: 2.5rem 1rem 3rem; }
    .nf-steps ol { grid-template-columns: 1fr; }
    .nf-join { grid-template-columns: 1fr; padding: 1.6rem; border-radius: 22px; }
    .nf-modal__dialog { padding: 1.4rem 1.1rem 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
    #nf-map, .nf-modal__dialog { transition: none; animation: none; }
}
