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

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    background: #101010;
    color: #222;
}

body {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* ================================
   App shell general
   ================================ */
.app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 980px;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #fff8e1 0, #f5f5f5 45%, #eeeeee 100%);
}

/* ================================
   Header
   ================================ */
.app-header {
    padding: 0.85rem 1rem 0.6rem;
    background: linear-gradient(135deg, #212121, #000000);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Logo arriba */
.logo-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.app-logo-img {
    width: 100px;
    height: auto;
    /* Para que el logo se vea un poco más integrado */
    filter: drop-shadow(0 0 8px rgba(255,193,7,0.4)); 
}

/* Cabecera principal */
.app-header-main {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    justify-content: center;
}

/* Nota: Se eliminaron los estilos del logo anterior */

.app-header-texts h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.app-header-texts .subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.78rem;
    opacity: 0.85;
}

.header-hint {
    margin: 0.45rem 0 0;
    font-size: 0.75rem;
}

/* ================================
   Layout principal
   ================================ */
.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

@media (min-width: 800px) {
    .app-container {
        flex-direction: row;
        align-items: stretch;
    }
}

/* ================================
   Panel lateral
   ================================ */
.panel {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 1rem;
    padding: 0.9rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.panel-section {
    padding-bottom: 0.35rem;
    border-bottom: 1px dashed #e0e0e0;
}

.panel-title {
    margin: 0 0 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
}

/* ================================
   Sección del mapa
   ================================ */
.map-section {
    margin-top: 0.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* En pantallas grandes: panel fijo y mapa ocupa todo lo demás */
@media (min-width: 800px) {
    .panel {
        flex: 0 0 360px;   /* ancho fijo aprox. del panel */
    }

    .map-section {
        flex: 1;           /* el mapa se expande con el resto del ancho */
    }
}


/* inputs */
.field-group input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 0.65rem;
    border: 1px solid #d1d1d1;
    font-size: 0.9rem;
    background: #fafafa;
}

.hint {
    display: block;
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    line-height: 1.25;
    color: #444;
}

input:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

/* fila de origen */
.origin-row {
    display: flex;
    gap: 0.4rem;
}

/* ================================
   Botón Mi ubicación (icono)
   ================================ */
.btn-location-icon {
    border: none;
    background: #ffffff;
    padding: 0.45rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.20);
    width: 42px;
    height: 42px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-location-icon:active {
    transform: scale(0.92);
}

.loc-icon-outer {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid #424242;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loc-icon-inner {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #0288d1;
}

/* ================================
   Avisos / Errores (más visibles)
   ================================ */
.error-message {
    margin: 0.45rem 0 0.25rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.85rem;

    border: 1px solid rgba(211, 47, 47, 0.35);
    background: rgba(211, 47, 47, 0.12);
    color: #b71c1c;

    font-weight: 800;
    font-size: 0.9rem;
    line-height: 1.25;
}


/* ================================
   Resultados
   ================================ */
.results {
    padding: 0.4rem;
    border-radius: 0.85rem;
    border: 1px solid #eee;
    background: #fafafa;
}

.route-summary {
    margin: 0.15rem 0 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #e3e3e3;
}

.route-line {
    margin: 0.1rem 0;
    font-size: 0.85rem;
    line-height: 1.25;
}

.results-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.results-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #fff3e0;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.results-item {
    padding: 0.35rem 0.45rem;
    border-radius: 0.7rem;
    border: 1px solid #eee;
    background: #ffffff;
}

.results-label {
    display: block;
    font-size: 0.75rem;
    color: #555;
    margin-bottom: 0.05rem;
}

.results-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
}

.fare {
    margin: 0.4rem 0 0;
    padding: 0.45rem 0.55rem;
    border-radius: 0.8rem;
    border: 1px solid rgba(255, 193, 7, 0.35);
    background: #fff8e1;

    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.fare-label {
    font-size: 0.8rem;
    font-weight: 800;
}

.fare-value {
    font-size: 1.05rem;
    font-weight: 900;
}

/* ================================
   Botón Nueva ruta
   ================================ */
.btn-primary {
    width: 100%;
    margin-top: 0.25rem;
    background: linear-gradient(135deg, #ffc107, #ffb300);
    color: #212121;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.75rem;
}

.btn-primary:disabled {
    opacity: 0.5;
}


.btn-secondary {
    width: 100%;
    margin-top: 0.5rem;
    background: #ffffff;
    color: #212121;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.75rem;
    border: 2px solid rgba(0,0,0,0.12);
}

.btn-secondary:disabled {
    opacity: 0.5;
}


/* ================================
   Mapa
   ================================ */
.map-container {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    height: 100%;
}


#map {
    width: 100%;
    height: 330px;
}

@media (min-width: 800px) {
    #map {
        height: 100%;
        min-height: 420px;
    }
}

/* ================================
   Map help
   ================================ */
.map-help {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 1rem;

    background: #1c1c1c;          /* tarjeta real en oscuro */
    border: 1px solid rgba(255,255,255,0.06);

    color: #f1f1f1;
    font-size: 0.85rem;
    line-height: 1.3;
}

.map-help strong {
    color: #ffc107;
}


/* ================================
   Footer
   ================================ */
/* ================================
   Footer (mobile first)
   ================================ */
.app-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;

    text-align: center;
    padding: 0.6rem 0.6rem 1.1rem;
    font-size: 0.75rem;

    background: #000;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.app-footer small {
    color: rgba(255,255,255,0.55);
}

/* Quita el margen extra del logo-wrapper (ese se pensó para el header) */
.app-footer .logo-wrapper {
    margin-bottom: 0;
}


.footer-logo-img {
    width: min(560px, 94vw);
    height: 120px;           /* 👈 esto es lo que lo hace “grande” en móvil */
    object-fit: contain;     /* no se deforma */
    display: block;
    margin: 0 auto;
    filter: none;            /* evita sombra exagerada en footer */
}


@media (min-width: 650px) {
    .app-footer {
        flex-direction: row;
        gap: 0.6rem;
    }

    .footer-logo-img {
        width: 240px;
        height: 56px;
        object-fit: contain;
    }
}
