/* ==========================================================================
   DUDEPARK™ · Diseño Minimalista Estilo iOS (Rediseño Limpio)
   ========================================================================== */

:root {
    --dp-bg: #050811;
    --dp-surface: rgba(15, 23, 42, 0.88);
    --dp-card: rgba(22, 30, 48, 0.85);
    --dp-border: rgba(255, 255, 255, 0.1);
    --dp-blue: #0066FF;
    --dp-cyan: #38BDF8;
    --dp-green: #10B981;
    --dp-amber: #F59E0B;
    --dp-red: #EF4444;
    --dp-text: #F8FAFC;
    --dp-muted: #94A3B8;
}

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

html {
    height: 100%;
    background-color: var(--dp-bg);
}

body {
    background: radial-gradient(circle at 50% 15%, rgba(0, 102, 255, 0.18) 0%, #050811 60%);
    background-color: var(--dp-bg);
    color: var(--dp-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', 'Inter', 'Segoe UI', Roboto, sans-serif;
    min-height: 100%;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

html.dp-is-landing {
    height: 100%;
    overflow: hidden;
}

body.dp-is-landing {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
}

.dp-hidden {
    display: none !important;
}

/* Header Minimalista */
.dp-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(5, 8, 17, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dp-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.02em;
    cursor: pointer;
}

.dp-topbar-brand svg {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.dp-login-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.dp-role-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid var(--dp-border);
    color: #E2E8F0;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 9px 28px 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
}

.dp-role-select option {
    background: #0F172A;
    color: white;
}

.dp-btn {
    border: none;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.14s ease, opacity 0.14s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.dp-btn:active {
    transform: scale(0.97);
}

.dp-btn-primary {
    background: linear-gradient(135deg, #0066FF, #0047BA);
    color: white;
    box-shadow: 0 8px 22px rgba(0, 102, 255, 0.35);
}

.dp-btn-green {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.32);
}

.dp-btn-ghost {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--dp-border);
    color: #E2E8F0;
}

.dp-btn-danger {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #FCA5A5;
}

.dp-btn-full {
    width: 100%;
    padding: 13px 18px;
    font-size: 0.95rem;
}

/* Portada Hero Centrada y Compacta (cabe completa en móvil sin scroll) */
.dp-landing {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 20px 28px;
}

.dp-hero-logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.dp-hero-svg {
    width: 108px;
    height: 108px;
    border-radius: 26px;
    box-shadow: 0 22px 60px rgba(0, 102, 255, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.dp-hero-wordmark {
    font-size: clamp(2.1rem, 6vw, 3.4rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #FFFFFF;
    line-height: 1;
}

.dp-hero-claim {
    font-size: clamp(1rem, 2.6vw, 1.3rem);
    font-weight: 700;
    color: #E2E8F0;
    max-width: 520px;
    line-height: 1.35;
    margin-bottom: 6px;
}

.dp-hero-footnote {
    font-size: 0.82rem;
    color: var(--dp-muted);
    max-width: 480px;
    margin-bottom: 20px;
}

.dp-admin-share-link {
    color: #38BDF8;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.dp-admin-share-link:hover,
.dp-admin-share-link:active {
    color: #7DD3FC;
}

.dp-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Contenedor Principal App Logueada */
.dp-shell {
    max-width: 780px;
    margin: 0 auto;
    padding: 20px 16px 96px;
}

.dp-card {
    background: var(--dp-card);
    border: 1px solid var(--dp-border);
    border-radius: 22px;
    padding: 20px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    margin-bottom: 16px;
}

.dp-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-card-sub {
    font-size: 0.86rem;
    color: var(--dp-muted);
    line-height: 1.45;
    margin-bottom: 16px;
}

.dp-input {
    width: 100%;
    background: rgba(5, 8, 17, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: 13px;
    color: white;
    padding: 12px 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.dp-input:focus {
    border-color: var(--dp-cyan);
}

.dp-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #CBD5E1;
    margin-bottom: 6px;
}

.dp-field {
    margin-bottom: 14px;
}

.dp-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.dp-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--dp-cyan);
}

.dp-pill.green {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34D399;
}

.dp-pill.amber {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #FBBF24;
}

/* Barra Inferior 3 Apartados Usuario */
.dp-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    display: flex;
    justify-content: center;
    background: rgba(9, 14, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}

.dp-tabbar-inner {
    width: 100%;
    max-width: 520px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.dp-tab-btn {
    background: transparent;
    border: none;
    color: var(--dp-muted);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 8px 6px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.dp-tab-btn .dp-tab-ico {
    font-size: 1.25rem;
    line-height: 1;
}

.dp-tab-btn.active {
    background: rgba(0, 102, 255, 0.18);
    color: #FFFFFF;
}

/* Botones de Puerta / Mando */
.dp-door-btn {
    width: 100%;
    background: linear-gradient(135deg, #0066FF, #0047BA);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    padding: 16px 18px;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 26px rgba(0, 102, 255, 0.3);
    margin-bottom: 10px;
}

.dp-door-btn.opening {
    background: linear-gradient(135deg, #0284C7, #0369A1);
}

.dp-door-btn.success {
    background: linear-gradient(135deg, #10B981, #059669);
}

/* Listas Limpias */
.dp-list-item {
    background: rgba(5, 8, 17, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 14px;
    margin-bottom: 10px;
}

.dp-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modales */
.dp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.dp-modal-card {
    width: 100%;
    max-width: 440px;
    background: #0F172A;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 26px;
    padding: 24px 22px;
    position: relative;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.8);
    max-height: 92vh;
    overflow-y: auto;
}

.dp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #CBD5E1;
    font-size: 1.2rem;
    cursor: pointer;
}

.dp-mono {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.dp-map-box {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--dp-border);
    margin-bottom: 14px;
}

details.dp-accordion {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 10px;
}

details.dp-accordion summary {
    list-style: none;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

details.dp-accordion summary::-webkit-details-marker {
    display: none;
}

details.dp-accordion .dp-accordion-body {
    padding: 0 14px 14px;
    font-size: 0.84rem;
    color: var(--dp-muted);
    line-height: 1.5;
}

/* Pie de página legal europeo */
.dp-footer {
    margin-top: auto;
    flex-shrink: 0;
    text-align: center;
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--dp-muted);
    font-size: 0.76rem;
}

.dp-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.dp-footer-link {
    color: #CBD5E1;
    text-decoration: none;
    font-weight: 600;
    background: none;
    border: none;
    font-size: 0.76rem;
    cursor: pointer;
    padding: 0;
}

.dp-footer-link:hover {
    color: var(--dp-cyan);
    text-decoration: underline;
}

/* Botón flotante Ayuda 24/7 abajo a la derecha */
.dp-help-fab {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 55;
    background: linear-gradient(135deg, #0066FF, #0047BA);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 10px 15px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 12px 28px rgba(0, 102, 255, 0.42);
}

@media (max-width: 640px) {
    .dp-topbar {
        padding: 10px 14px;
    }
    .dp-landing {
        justify-content: center;
        padding: 8px 18px 26px;
    }
    .dp-hero-logo-box {
        gap: 10px;
        margin-bottom: 14px;
    }
    .dp-hero-svg {
        width: 92px;
        height: 92px;
        border-radius: 23px;
    }
    .dp-hero-wordmark {
        font-size: 2.05rem;
    }
    .dp-hero-claim {
        font-size: 0.98rem;
        margin-bottom: 4px;
    }
    .dp-hero-footnote {
        font-size: 0.78rem;
        margin-bottom: 16px;
    }
    .dp-footer {
        padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
        font-size: 0.7rem;
    }
    .dp-footer-links {
        gap: 12px;
        margin-bottom: 4px;
    }
    .dp-help-fab {
        right: 12px;
        bottom: calc(62px + env(safe-area-inset-bottom));
        padding: 8px 13px;
        font-size: 0.76rem;
    }
}

.dp-help-fab:active {
    transform: scale(0.96);
}

/* Chat Interactivo Ayuda 24/7 */
.dp-help-messages {
    height: 250px;
    overflow-y: auto;
    background: rgba(5, 8, 17, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-help-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.dp-help-row.user {
    justify-content: flex-end;
}

.dp-help-bubble {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.45;
}

.dp-help-row.bot .dp-help-bubble {
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #E2E8F0;
    border-bottom-left-radius: 4px;
}

.dp-help-row.user .dp-help-bubble {
    background: linear-gradient(135deg, #0066FF, #0047BA);
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.dp-help-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.dp-help-chip {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7DD3FC;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.dp-help-form {
    display: flex;
    gap: 8px;
}
