/* ── Layout shell: navbar fixo + conteúdo + footer fixo ── */

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

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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    background: var(--rc-bg);
    font-family: var(--rc-font);
    color: var(--rc-text);
    -webkit-tap-highlight-color: rgba(183, 28, 28, 0.12);
    overscroll-behavior-y: none;
}

/* Mobile: bloqueia pinch-zoom e zoom por duplo toque na página */
@media (max-width: 991.98px) {
    html,
    body {
        touch-action: manipulation;
        -ms-touch-action: manipulation;
    }

    /* Mapa mantém gestos de zoom */
    .rc-map-host,
    #mapBrasil,
    #mapa,
    #map_canvas {
        touch-action: auto;
        -ms-touch-action: auto;
    }

    /* iOS dá zoom ao focar campo com fonte < 16px */
    input,
    select,
    textarea {
        font-size: 16px;
    }
}

.rc-page-content:has(.auth-wrap) {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Rodapé enxuto: login, cadastro e telas internas da plataforma */
body.rc-footer-compact .rc-footer-grid { display: none; }

body.rc-footer-compact .rc-footer {
    border-top-width: 1px;
}

body.rc-footer-compact .rc-footer-bottom {
    border-top: none;
    padding: 10px 16px;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

body.rc-footer-compact .rc-footer-copy {
    font-size: 10.5px;
}

/* Login / recuperar / redefinir: preenche viewport e centraliza o card */
body:has(.auth-wrap:not(.auth-wrap--form)) {
    min-height: 100dvh;
}

.rc-page-content {
    flex: 1 0 auto;
    width: 100%;
}
/* ── Navbar ── */
.rc-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--rc-navbar-h);
    padding: 0 20px;
    padding-top: env(safe-area-inset-top, 0);
    background: var(--rc-surface);
    border-bottom: 3px solid var(--rc-primary);
    box-shadow: var(--rc-shadow);
}

.rc-navbar-spacer {
    height: var(--rc-navbar-h);
    flex-shrink: 0;
}

.rc-nav-left {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.rc-nav-brand {
    margin-right: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.rc-nav-brand img {
    height: 32px;
    width: auto;
    display: block;
}

.rc-nav-divider {
    width: 1px;
    height: 24px;
    background: var(--rc-border);
    margin-right: 12px;
    flex-shrink: 0;
}

.rc-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rc-nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #555;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.rc-nav-links a i {
    font-size: 13px;
    color: var(--rc-primary);
    opacity: 0.75;
}

.rc-nav-links a:hover {
    background: #fbe9e7;
    color: var(--rc-primary);
}

.rc-nav-links a.active {
    background: #fbe9e7;
    color: var(--rc-primary);
    box-shadow: inset 0 0 0 2px rgba(183, 28, 28, 0.22);
}

.rc-nav-links a:hover i,
.rc-nav-links a.active i {
    opacity: 1;
}

.rc-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Botões globais ── */
.rc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    border: none;
    line-height: 1;
    font-family: inherit;
}

.rc-btn i { font-size: 13px; line-height: 1; }

.rc-btn .material-icons { font-size: 16px; line-height: 1; }

.rc-btn-primary {
    background: var(--rc-primary);
    color: #fff !important;
}

.rc-btn-primary i { color: #fff !important; }

.rc-btn-primary:hover,
.rc-btn-primary.active {
    background: var(--rc-primary-dark);
    color: #fff !important;
    text-decoration: none;
}

.rc-btn-primary.active {
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.rc-btn-secondary {
    background: #f5f5f5;
    color: #555 !important;
    border: 1px solid var(--rc-border);
}

.rc-btn-secondary i { color: #555 !important; }

.rc-btn-secondary:hover {
    background: #eee;
    color: #333 !important;
    text-decoration: none;
}

.rc-btn-outline {
    background: #fff;
    color: #555 !important;
    border: 1px solid var(--rc-border);
}

.rc-btn-outline:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.rc-btn-block { width: 100%; }

.rc-btn-lg {
    height: 42px;
    padding: 0 20px;
    font-size: 12px;
}

/* ── Bottom nav (mobile / PWA) ── */
.rc-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    height: calc(var(--rc-bottom-nav-h) + env(safe-area-inset-bottom, 0));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}

.rc-bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: var(--rc-bottom-nav-h);
    padding: 6px 4px 8px;
    text-decoration: none;
    color: #888;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.rc-bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--rc-primary);
    transition: transform 0.2s ease;
}

.rc-bottom-nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.rc-bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    transition: background 0.15s, transform 0.15s;
}

.rc-bottom-nav-icon .material-icons {
    font-size: 22px;
    line-height: 1;
}

.rc-bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rc-bottom-nav-item.active {
    color: var(--rc-primary);
}

.rc-bottom-nav-item.active .rc-bottom-nav-icon {
    background: #fbe9e7;
}

.rc-bottom-nav-item:active .rc-bottom-nav-icon {
    transform: scale(0.92);
}

@media (hover: hover) {
    .rc-bottom-nav-item:hover {
        color: var(--rc-primary);
    }
}

/* ── Footer ── */
.rc-footer {
    flex-shrink: 0;
    background: var(--rc-surface);
    border-top: 3px solid var(--rc-primary);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.rc-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    max-width: 960px;
    margin: 0 auto;
    padding: 36px 32px 24px;
}

.rc-footer-brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.rc-footer-brand:hover {
    opacity: 0.88;
}

.rc-footer-brand img {
    height: 40px;
    width: auto;
    max-width: min(220px, 100%);
    display: block;
    object-fit: contain;
    object-position: left center;
}

.rc-footer-desc {
    font-size: 12.5px;
    color: #888;
    line-height: 1.65;
    max-width: 260px;
    margin: 0;
}

.rc-footer-heading {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--rc-primary);
    margin: 0 0 12px;
}

.rc-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rc-footer-links li { margin-bottom: 9px; }

.rc-footer-links a {
    font-size: 12.5px;
    color: #555;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s;
}

.rc-footer-links a:hover { color: var(--rc-primary); }

.rc-footer-links a.active {
    color: var(--rc-primary);
    font-weight: 700;
}

.rc-footer-links a i {
    color: var(--rc-primary);
    width: 14px;
    font-size: 13px;
}

.rc-footer-bottom {
    border-top: 1px solid #f0f0f0;
    padding: 14px 32px;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.rc-footer-copy {
    font-size: 11.5px;
    color: #aaa;
}

.rc-footer-credit {
    color: var(--rc-primary);
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.rc-footer-cookie-prefs {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
}

.rc-footer-cookie-prefs:hover,
.rc-footer-cookie-prefs:focus {
    color: var(--rc-primary);
}

/* ── Responsivo layout ── */
@media (max-width: 900px) {
    .rc-nav-links,
    .rc-nav-divider,
    .rc-nav-right { display: none; }

    .rc-navbar {
        justify-content: center;
        padding-left: 16px;
        padding-right: 16px;
    }

    .rc-nav-left {
        flex: 1;
        justify-content: center;
    }

    .rc-nav-brand {
        margin-right: 0;
    }

    .rc-bottom-nav {
        display: flex;
        align-items: stretch;
    }

    body.rc-app-shell {
        padding-bottom: calc(var(--rc-bottom-nav-h) + env(safe-area-inset-bottom, 0));
    }

    body.rc-app-shell .rc-footer-grid {
        display: none;
    }

    body.rc-app-shell .rc-footer {
        border-top-width: 1px;
        margin-bottom: 0;
    }

    body.rc-app-shell .rc-footer-bottom {
        padding: 10px 16px 12px;
        justify-content: center;
        text-align: center;
    }

    body.rc-app-shell .rc-page-footer {
        margin-bottom: 8px;
    }
}

@media (max-width: 700px) {
    .rc-footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 28px 20px 20px;
    }
}

@media (max-width: 480px) {
    .rc-navbar { padding: 0 12px; }

    .rc-nav-brand img { height: 28px; }

    .rc-footer-grid { padding: 24px 16px 16px; }

    .rc-footer-bottom {
        padding: 14px 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rc-bottom-nav-label {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    :root {
        --rc-navbar-h: 52px;
        --rc-bottom-nav-h: 60px;
    }
}

/* PWA standalone: splash / letterbox vermelho na abertura */
@media all and (display-mode: standalone) {
    html {
        background-color: #940400;
    }

    .rc-bottom-nav {
        background: rgba(255, 255, 255, 0.98);
    }
}
