/* ===================== FreTur · Frontend Turista (Escritorio) ===================== */
:root {
    --bg: #0f1226;
    --bg-2: #161a33;
    --card: #1a1f3d;
    --card-border: rgba(255,255,255,0.08);
    --text: #e7eaf4;
    --muted: #9aa3c4;
    --primary: #f97316;
    --primary-2: #fb923c;
    --accent: #22d3ee;
    --danger: #ef4444;
    --success: #34d399;
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0,0,0,0.45);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
[data-theme="light"] {
    --bg: #eef1f8;
    --bg-2: #e3e8f4;
    --card: #ffffff;
    --card-border: rgba(20,30,70,0.10);
    --text: #1b2240;
    --muted: #5a6486;
    --shadow: 0 12px 40px rgba(30,50,120,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    background: radial-gradient(1200px 600px at 80% -10%, rgba(34,211,238,0.10), transparent 60%),
                radial-gradient(900px 500px at -10% 110%, rgba(249,115,22,0.12), transparent 55%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
}
.tt-container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
a { color: inherit; text-decoration: none; }

/* ---------- Botones ---------- */
.tt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border: 1px solid transparent; border-radius: 10px;
    padding: 0.65rem 1.1rem; font-size: 0.92rem; font-weight: 600;
    cursor: pointer; transition: transform .12s, box-shadow .12s, background .15s, opacity .15s;
    font-family: inherit; color: var(--text); background: var(--bg-2);
}
.tt-btn:hover { transform: translateY(-1px); }
.tt-btn:active { transform: translateY(0); }
.tt-btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.tt-btn-block { width: 100%; }
.tt-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff; box-shadow: 0 6px 18px rgba(249,115,22,0.35);
}
.tt-btn-ghost { background: transparent; border-color: var(--card-border); color: var(--text); }
.tt-btn-ghost:hover { background: var(--card); }
.tt-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
kbd {
    background: var(--card); border: 1px solid var(--card-border); border-bottom-width: 2px;
    border-radius: 6px; padding: 1px 7px; font-size: 0.78rem; font-family: inherit; margin: 0 1px;
}

/* ---------- Cabecera ---------- */
.tt-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}
.tt-header-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.tt-logo { display: flex; align-items: center; gap: 0.55rem; font-size: 1.25rem; font-weight: 800; }
.tt-logo i { color: var(--primary); }
.tt-logo strong { color: var(--primary); }
.tt-badge {
    font-size: 0.62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: rgba(34,211,238,0.16); color: var(--accent); padding: 3px 8px; border-radius: 999px; margin-left: 0.3rem;
}
.tt-header-actions { display: flex; align-items: center; gap: 0.6rem; }
.tt-user { font-size: 0.9rem; color: var(--muted); }

/* ---------- Pantallas ---------- */
.tt-screen { display: none; }
.tt-screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Campos ---------- */
.tt-field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.tt-field label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
input, select, textarea {
    width: 100%; padding: 0.7rem 0.85rem; border-radius: 10px;
    background: var(--bg-2); border: 1px solid var(--card-border); color: var(--text);
    font-family: inherit; font-size: 0.95rem; outline: none; transition: border .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 90px; }
.tt-alert { padding: 0.65rem 0.85rem; border-radius: 10px; font-size: 0.85rem; margin-bottom: 0.8rem; }
.tt-alert.error { background: rgba(239,68,68,0.12); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.tt-alert.success { background: rgba(52,211,153,0.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }

/* ---------- Autenticación ---------- */
.auth-split { display: grid; grid-template-columns: 1.1fr 0.9fr; min-height: 100vh; }
.auth-hero {
    background: linear-gradient(150deg, #16213e, #0f3460 70%);
    display: flex; align-items: center; padding: 3rem; position: relative; overflow: hidden;
}
.auth-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(600px 300px at 70% 20%, rgba(249,115,22,0.25), transparent 60%);
}
.auth-hero-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-hero h1 { font-size: 2.6rem; line-height: 1.1; font-weight: 800; margin-bottom: 1rem; color: #fff; }
.auth-hero p { color: #c7d0e8; font-size: 1.02rem; line-height: 1.5; margin-bottom: 1.5rem; }
.auth-hero-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.auth-hero-list li { color: #e7eaf4; display: flex; align-items: center; gap: 0.7rem; font-size: 0.95rem; }
.auth-hero-list i { color: var(--accent); width: 20px; text-align: center; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; background: var(--bg-2); padding: 4px; border-radius: 10px; }
.auth-tab { flex: 1; padding: 0.55rem; border: none; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-weight: 600; font-family: inherit; }
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.quick-login { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--card-border); text-align: center; }
.quick-login-label { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.5rem; }

/* ---------- Catálogo ---------- */
#screen-catalog, #screen-detail { padding: 2rem 0 3rem; }
.catalog-head { margin-bottom: 1.2rem; }
.catalog-head h2 { font-size: 1.8rem; }
.catalog-filters { display: flex; gap: 0.7rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.search-field { position: relative; flex: 1; min-width: 220px; margin: 0; }
.search-field i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { padding-left: 2.4rem; }
.catalog-filters select { max-width: 200px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.loading-block { text-align: center; padding: 3rem; color: var(--muted); grid-column: 1 / -1; }

.route-card {
    background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
    overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column;
}
.route-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: rgba(249,115,22,0.4); }
.route-card-media { position: relative; height: 170px; background: var(--bg-2); }
.route-card-media img, .route-card-media video { width: 100%; height: 100%; object-fit: cover; }
.route-card-price { position: absolute; top: 0.7rem; right: 0.7rem; background: rgba(0,0,0,0.65); color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.route-card-price.free { background: var(--success); color: #06281d; }
.route-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.route-card-guide { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--muted); }
.route-card-guide img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.route-card-body h4 { font-size: 1.05rem; line-height: 1.25; }
.route-card-body .rc-desc { font-size: 0.84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.route-card-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); margin-top: auto; padding-top: 0.4rem; }

/* ---------- Detalle ---------- */
.back-btn { margin-bottom: 1.2rem; }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.detail-media { height: 280px; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); margin-bottom: 1.2rem; }
.detail-media img, .detail-media video { width: 100%; height: 100%; object-fit: cover; }
#detail-title { font-size: 2rem; margin-bottom: 0.6rem; }
.detail-meta { display: flex; gap: 1.2rem; color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; flex-wrap: wrap; }
.detail-desc { line-height: 1.6; color: var(--text); margin-bottom: 1.6rem; }
.detail-subtitle { margin: 1.6rem 0 0.8rem; font-size: 1.15rem; display: flex; align-items: center; gap: 0.5rem; }
.detail-subtitle i { color: var(--primary); }
.poi-preview-list { list-style: none; counter-reset: poi; display: flex; flex-direction: column; gap: 0.6rem; }
.poi-preview-list li { counter-increment: poi; background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 0.7rem 0.9rem 0.7rem 2.6rem; position: relative; }
.poi-preview-list li::before { content: counter(poi); position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; }
.poi-preview-list li .poi-type { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }

.review-item { background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 0.9rem; margin-bottom: 0.7rem; }
.review-item .rv-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.review-item .rv-stars { color: #fbbf24; font-size: 0.82rem; }
.review-item .rv-name { font-weight: 600; font-size: 0.9rem; }
.review-item .rv-text { color: var(--muted); font-size: 0.88rem; }

.detail-aside { position: sticky; top: 84px; }
.tt-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.detail-price { font-size: 1.8rem; font-weight: 800; color: var(--primary); margin-bottom: 0.4rem; }
.detail-guide { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; color: var(--muted); font-size: 0.88rem; }
.detail-guide img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* ---------- Tour (mapa pantalla completa) ---------- */
#screen-tour.active { display: block; }
.tour-wrap { position: fixed; inset: 0; z-index: 100; background: var(--bg); }
#tour-map { position: absolute; inset: 0; }
.tour-topbar {
    position: absolute; top: 0; left: 0; right: 0; z-index: 10;
    display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.2rem;
    background: linear-gradient(180deg, rgba(10,12,30,0.85), transparent);
}
.tour-progress { flex: 1; max-width: 420px; }
.tour-progress-text { font-size: 0.85rem; }
.tour-progress-bar { height: 7px; background: rgba(255,255,255,0.18); border-radius: 999px; margin-top: 5px; overflow: hidden; }
#tour-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s; }
.tour-speed { display: flex; align-items: center; gap: 0.5rem; color: #fff; }
.tour-speed input { width: 120px; }
.tour-topbar .tt-btn-ghost { background: rgba(0,0,0,0.4); color: #fff; border-color: rgba(255,255,255,0.2); }

.tour-hud {
    position: absolute; left: 1.2rem; bottom: 1.5rem; z-index: 10;
    display: flex; align-items: center; gap: 1rem;
    background: rgba(15,18,38,0.88); backdrop-filter: blur(8px);
    border: 1px solid var(--card-border); border-radius: 16px; padding: 0.9rem 1.2rem; box-shadow: var(--shadow);
}
.hud-compass { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-2); display: flex; align-items: center; justify-content: center; border: 2px solid var(--primary); }
.hud-compass i { font-size: 1.5rem; color: var(--primary); transition: transform .15s; }
.hud-info { display: flex; flex-direction: column; }
.hud-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hud-info strong { font-size: 1.05rem; }
.hud-dist { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

.tour-controls-help {
    position: absolute; right: 1.2rem; bottom: 1.5rem; z-index: 10;
    background: rgba(15,18,38,0.85); border: 1px solid var(--card-border); border-radius: 12px;
    padding: 0.6rem 0.9rem; font-size: 0.8rem; color: var(--muted);
}

.poi-panel {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 20;
    width: min(440px, 92vw); background: var(--card); border-left: 1px solid var(--card-border);
    box-shadow: -10px 0 40px rgba(0,0,0,0.5); padding: 2rem 1.8rem; overflow-y: auto;
    animation: slideIn .3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.poi-panel-close { position: absolute; top: 1rem; right: 1rem; background: var(--bg-2); border: none; color: var(--text); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.poi-panel-tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: var(--success); background: rgba(52,211,153,0.12); padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.poi-panel h2 { font-size: 1.5rem; margin: 0.8rem 0 1rem; }
.poi-panel-media { margin-bottom: 1rem; border-radius: 10px; overflow: hidden; }
.poi-panel-media img, .poi-panel-media video { width: 100%; border-radius: 10px; }
.poi-panel-media audio { width: 100%; }
.poi-panel-media .pdf-link { display: inline-flex; gap: 0.5rem; align-items: center; padding: 0.8rem 1rem; background: var(--bg-2); border-radius: 10px; }
.poi-panel p { line-height: 1.6; color: var(--text); margin-bottom: 1.4rem; }

/* ---------- Marcadores ---------- */
.tourist-marker { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(34,211,238,0.3), 0 2px 8px rgba(0,0,0,0.5); }
.poi-marker { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: var(--primary); transform: rotate(-45deg); border: 2px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.poi-marker i { transform: rotate(45deg); color: #fff; font-size: 0.8rem; }
.poi-marker.done { background: var(--success); }
.poi-marker.current { background: var(--accent); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,211,238,0.5); } 50% { box-shadow: 0 0 0 12px rgba(34,211,238,0); } }

/* ---------- Modales ---------- */
.tt-modal { position: fixed; inset: 0; z-index: 200; background: rgba(5,7,18,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.tt-modal-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 420px; box-shadow: var(--shadow); position: relative; text-align: center; }
.tt-modal-close { position: absolute; top: 1rem; right: 1rem; background: var(--bg-2); border: none; color: var(--text); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.tt-modal-card h3 { font-size: 1.4rem; margin-bottom: 0.6rem; }
.review-celebrate { font-size: 3rem; color: var(--primary); margin-bottom: 0.4rem; }
.rating-stars { display: flex; justify-content: center; gap: 0.4rem; font-size: 2rem; color: #fbbf24; margin: 1rem 0; cursor: pointer; }
.rating-stars i { cursor: pointer; transition: transform .1s; }
.rating-stars i:hover { transform: scale(1.15); }
#tip-block { margin: 1rem 0; }
.tip-label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
.tip-buttons { display: flex; gap: 0.5rem; justify-content: center; }
.tip-btn { flex: 1; padding: 0.55rem; border: 1px solid var(--card-border); background: var(--bg-2); color: var(--text); border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: 600; }
.tip-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#form-review textarea { margin-bottom: 0.8rem; }

/* ---------- Toast ---------- */
.tt-toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(140%);
    background: var(--card); border: 1px solid var(--card-border); color: var(--text);
    padding: 0.8rem 1.3rem; border-radius: 12px; box-shadow: var(--shadow); z-index: 300;
    transition: transform .35s; font-size: 0.9rem; max-width: 90vw;
}
.tt-toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-aside { position: static; }
}
