:root {
    --bg-grad-a: #d5f0ff;
    --bg-grad-b: #f0ffe5;
    --card-bg: rgba(255, 255, 255, 0.96);
    --text-main: #153046;
    --text-soft: #5f7489;
    --accent: #33bf5a;
    --accent-strong: #26a64a;
    --primary-btn: #2b90ff;
    --primary-btn-strong: #1d7eea;
    --shadow-lg: 0 16px 42px rgba(20, 56, 80, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'Nunito', sans-serif;
    background: radial-gradient(circle at top left, var(--bg-grad-a), var(--bg-grad-b) 58%);
    color: var(--text-main);
}

#app-container {
    position: relative;
    width: min(1280px, 100vw);
    height: 100vh;
    height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 0;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.leaflet-map-pane {
    transform-origin: center center;
}

.topbar {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 900;
    display: flex;
    gap: 10px;
    align-items: center;
}

.brand-pill {
    background: var(--card-bg);
    border-radius: 999px;
    padding: 11px 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(140deg, #ffce2f, #ff843f);
}

.brand-pill h1 {
    font-size: 1rem;
    font-weight: 800;
}

#form-busca {
    flex: 1;
    background: var(--card-bg);
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#input-endereco {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 6px 12px;
    outline: none;
}

#input-endereco::placeholder {
    color: #7f95a9;
}

#btn-buscar,
#btn-localizacao,
#btn-limpar-rota {
    border: none;
    border-radius: 999px;
    color: #fff;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.2s ease;
}

#btn-buscar {
    background: var(--accent);
    padding: 11px 18px;
}

#btn-buscar:hover,
#btn-localizacao:hover,
#btn-limpar-rota:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.floating-actions {
    position: absolute;
    right: 14px;
    top: 86px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#btn-localizacao,
#btn-limpar-rota {
    padding: 11px 14px;
    min-width: 132px;
    box-shadow: var(--shadow-lg);
}

#btn-localizacao {
    background: var(--primary-btn);
}

#btn-limpar-rota {
    background: #fb7185;
}

.trip-card {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 900;
    background: var(--card-bg);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#status-viagem {
    color: var(--text-soft);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    word-wrap: break-word;
}

.trip-stats {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#distancia,
#duracao {
    background: #eaf5ff;
    color: #1f5c8d;
    font-size: 0.86rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 8px 12px;
}

.leaflet-routing-container {
    display: none !important;
}

.heading-arrow {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.heading-triangle {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 22px solid #2178ff;
    filter: drop-shadow(0 2px 4px rgba(33, 120, 255, 0.4));
    position: relative;
}

.heading-triangle::after {
    content: '';
    position: absolute;
    top: 10px;
    left: -5px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 11px solid #fff;
}

.pin-dot.end {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #2fb34f;
    box-shadow: 0 0 0 3px rgba(47, 179, 79, 0.25);
}

@media (min-width: 1024px) {
    #app-container {
        height: calc(100vh - 24px);
        margin: 12px auto;
        border-radius: 22px;
        box-shadow: var(--shadow-lg);
    }

    .topbar {
        left: 18px;
        right: 18px;
        top: 18px;
    }

    .floating-actions {
        right: 18px;
        top: 92px;
    }

    .trip-card {
        left: 18px;
        right: 18px;
        bottom: 18px;
    }
}

@media (max-width: 760px) {
    .topbar {
        flex-wrap: wrap;
    }

    .brand-pill {
        order: 1;
    }

    #form-busca {
        order: 2;
        width: 100%;
    }

    .floating-actions {
        top: auto;
        right: 14px;
        bottom: 105px;
    }

    #btn-localizacao,
    #btn-limpar-rota {
        min-width: 110px;
        padding: 10px 12px;
        font-size: 0.84rem;
    }

    .trip-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        padding: 10px 14px;
        bottom: 10px;
    }

    .trip-stats {
        width: 100%;
        justify-content: center;
    }

    #status-viagem {
        font-size: 0.85rem;
    }
}
