:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --secondary: #38bdf8;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Navbar */
.navbar {
    background: var(--surface);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
}

.btn-login {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

/* Main Layout */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Map Section */
.map-section {
    flex: 2;
    position: relative;
    border-right: 1px solid #e2e8f0;
}

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

.map-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.map-overlay h2 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.map-overlay p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Chat Section */
.chat-section {
    flex: 1;
    min-width: 350px;
    max-width: 450px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to right, #f0f9ff, #e0f2fe);
}

.avatar-3d img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.chat-header h3 {
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.status {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8fafc;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
    border: 1px solid #e2e8f0;
}

.user-message {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.chat-input-area {
    padding: 1rem;
    background: var(--surface);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: var(--primary);
}

#chat-send {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 1.25rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#chat-send:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .map-section {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
    .chat-section {
        flex: 1.5;
        max-width: 100%;
    }
}

/* Añadidos para la Landing Page y Ley 21.719 */
.landing-body {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    justify-content: center;
    align-items: center;
}

.landing-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    margin: 0 auto;
}

.auth-box {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    text-align: center;
}

.auth-box h2 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.home-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-light);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.home-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-box p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.roles-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.role-btn {
    background: var(--surface);
    border: 2px solid transparent;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.role-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.consent-box {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    font-size: 0.85rem;
    color: #92400e;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.consent-box input[type="checkbox"] {
    margin-top: 4px;
}

.btn-login-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background: white;
    border: 1px solid #cbd5e1;
    color: var(--text);
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login-google img {
    width: 20px;
    height: 20px;
}

.btn-login-google:hover:not(:disabled) {
    background: #f8fafc;
}

.btn-login-google:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}
input:checked + .slider {
    background-color: #10b981;
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}
